<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>项目信息</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<style>
    /*.pageInTab .l-tab-links{
        overflow-x: scroll;
        height : 37px;
    }
    !*.pageInTab .l-tab-links-right,.pageInTab .l-tab-links-left{
        display: none;
    }*!
    .l-tab-links::-webkit-scrollbar {
        !*滚动条整体样式*!
        width: 10px;  !*高宽分别对应横竖滚动条的尺寸*!
        height: 10px;
    }
    .l-tab-links::-webkit-scrollbar-thumb {
        !*滚动条里面小方块*!
        border-radius: 10px;
        box-shadow   : inset 0 0 5px rgba(0, 0, 0, 0.2);
        background: #139a5f;
    }
    .l-tab-links::-webkit-scrollbar-track {
        !*滚动条里面轨道*!
        box-shadow   : inset 0 0 5px rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        background   : #ededed;
    }
    .pageInTab .l-tab-links ul {
        left: 0px;
    }*/
</style>
<body class="iframeBody">
<div class="Wrapper">
    <div>
        <div id="pageInTab" class="pageInTab">
            <div tabid="tabA" title="基本信息" id="tabAId" lselected="true">
                <form id="prj_bsc_info_form">
                    <div class="fieldset1 tabel_col clearFix">
                        <div class="caption">
                            <div class="btnsBox posR">
                                <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjBscInfo" pInstId="${pInstId}">
                                    <span id="chooseCst" class="sq-button sq-button-round" onclick="chooseCstPage()">选择客户</span>
                                </sys:FlowFrmAth>
                            </div>
                            <span>&nbsp;</span>
                            <!--  <span>&nbsp;</span> -->
                        </div>
                        <!--  <div class="fieldBox col_33">
                             <div class="label">项目名称</div>
                             <div class="field">
                                 <input id="prjNm" name="prjNm" type="text"  class="ui-textbox"  value=""  validate="{required:true}" />
                                 <span class="requiredSymbol">*</span>
                             </div>
                         </div> -->
                        <div class="fieldBox col_33">
                            <div class="label">所属机构</div>
                            <div class="field">
                                <input name="orgCd" id="orgCd" type="text" class="ui-textbox" value="" placeholder="请选择"
                                       ltype="combobox">
                            </div>
                            <div style="display: none">
                            </div>
                        </div>
                        <div class="fieldBox col_33">
                            <div class="label">项目所属客户经理</div>
                            <div class="field">
                                <select name="cstMgrId" id="cstMgrId" onchange="changeSelectOrgCd();"
                                        validate="{required:true}">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${actMgrList}" var="mgr">
                                        <option value="${mgr.id}" cstMgrOrgCd="${mgr.orgCd}" cstMgrNm="${mgr.refRlNm}"
                                            <%-- <c:if test="${mgr.id==cstMgrId}">selected="selected"</c:if> --%>
                                        >${mgr.refRlNm}${mgr.usrNm}</option>
                                    </c:forEach>
                                    <%--   <c:forEach items="actMgrList" var="mgr">
                                         <option value="${mgr.id}" cstMgrOrgCd="${mgr.orgCd}" cstMgrNm="${mgr.usrNm}"
                                         <c:if test="${mgr.id==cstMgrId }">selected="selected"</c:if>>${mgr.usrNm}</option>
                                     </c:forEach>  --%>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <%--    <div class="fieldBox col_33"  id="cstNmDiv" style="display: none">
                               <div class="label">客户名称</div>
                               <div class="field">
                                   <a href="javascript:showCstDetail()" class="link">
                                   <span name="cstNm" id="cstNm">&nbsp;</span>
                               </a>
                                 </div>
                           </div>
                            <input type="hidden"  id="cstId" name="cstId"  class="ui-textbox" value="${cstId}">
                            <div class="formBtns notRight"  id="chooseCstDiv" >
                                  <span id="chooseCst" class="sq-button-round"  style="color: red" onclick="chooseCstPage()"><!-- <i class="sqBtnIco_3"></i> -->选择客户</span>
                              </div> --%>
                        <%-- <div class="fieldBox col_100_auto">
                              <div class="label">区域</div>
                              <div class="field">
                                  <jsp:include page="../../system/sysRegion/region.jsp" flush="true" >
                                      <jsp:param name="regionShowLvl" value="2"/>
                                  </jsp:include>
                              </div>
                               <span class="requiredSymbol">*</span>
                              </div> --%>


                        <!--业务类型  -->
                        <div class="fieldBox col_33">
                            <div class="label">业务模式</div>
                            <div class="field">
                                <select name="bizTypCd" id="bizTypCd" onchange="changeSelectSun();"
                                        validate="{required:true}">
                                    <option value="">--请选择--</option>
                                    <c:forEach items="${bizTypCdList}" var="opt">
                                        <option value="${opt.key}">${opt.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <%--  <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageForm" cmpDtlCd="bizTypCd" ></ui:normalSelect> --%>
                        <%--      <div class="fieldBox col_33">
                                   <div class="label">数据来源</div>
                                   <div class="field">
                                   <select name="dsCd"  id="dsCd" >
                                      <option value="  " selected="selected">--请选择--</option>
                                        <c:forEach items="${dsList}" var="opt">
                                         <option value="${opt.key}">${opt.value}</option>
                                        </c:forEach>
                                    </select>
                                   </div>

                               </div> --%>
                        <%--              <div class="fieldBox col_33">
                                        <div class="label">业务种类</div>
                                        <div class="field">
                                        <select name="loanTypCd"  id="loanTypCd"  disabled="disabled">
                                           <option value="  " selected="selected">--请选择--</option>
                                             <c:forEach items="${loanTypCdList}" var="opt">
                                              <option value="${opt.key}">${opt.value}</option>
                                             </c:forEach>
                                         </select>
                                        </div>
                                    </div> --%>

                        <c:if test="${buOrgCd =='00000005'}">
                            <!-- 汽车金融 -->
                            <!-- 代理商类型 -->
                            <%--    <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR" cmpDtlCd="agntTypCd" orgCds="${orgCds }"></ui:normalSelect> --%>
                            <!-- 是否团单 --><!-- pgCd:页面代码  cmpCd:组件代码  cmpDtlCd:页面字段 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR"
                                             cmpDtlCd="isGrpBizForQCJR" orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 业务类型 -->
                            <%--  <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR" cmpDtlCd="subBizTypCd" orgCds="${orgCds }"></ui:normalSelect> --%>
                            <!-- 业务形式 -->
                            <%-- <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR" cmpDtlCd="bizModCd" orgCds="${orgCds }"></ui:normalSelect> --%>
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormQCJR" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>

                        </c:if>

                        <c:if test="${buOrgCd =='00000008'}">
                            <!-- 专车 -->
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZC" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZC" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>

                            <!-- 代理商类型 -->
                            <%-- <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZC" cmpDtlCd="agntTypCd" orgCds="${orgCds }"></ui:normalSelect>
                           <!-- 是否团单 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZC" cmpDtlCd="isGrpBiz" orgCds="${orgCds }"></ui:normalSelect> --%>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZC" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 采购类型 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZCDG" cmpDtlCd="buyType"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 租赁物用途 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZCKC"
                                             cmpDtlCd="prjIndCdZc" orgCds="${orgCds }"></ui:normalSelect>
                            <%--    <!-- 其他行业（租赁物用途）（专车） -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZCKC" cmpDtlCd="prjOthIndCd" orgCds="${orgCds }"></ui:normalInput> --%>

                        </c:if>

                        <c:if test="${buOrgCd =='00000008'}">
                            <!-- 医疗 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYL" cmpDtlCd="prjTypCd"
                                         orgCds="${orgCds }"></ui:normalSelect>
                        </c:if>

                        <c:if test="${buOrgCd =='00000013'}">
                            <!-- 新能源汽车 -->
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormXNY" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormXNY" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormXNY" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 租赁物用途 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormXNY"
                                             cmpDtlCd="prjIndCdXny" orgCds="${orgCds }"></ui:normalSelect>
                        </c:if>

                        <c:if test="${buOrgCd =='00000007'}">
                            <!--卡云 -->
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
                            <!-- 代理商类型 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="agntTypCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 是否团单 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="isGrpBiz"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 租赁物用途 -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="prjIndCd"
                                            orgCds="${orgCds }"></ui:normalInput>
                            <!-- 其他行业（租赁物用途）（重卡） -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormKY" cmpDtlCd="prjOthIndCd"
                                            orgCds="${orgCds }"></ui:normalInput>
                        </c:if>

                        <c:if test="${buOrgCd =='00000001'}">
                            <!-- 重卡 -->
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }" orgCd="${currOrg}"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
                            <!-- 代理商类型 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="agntTypCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 是否团单 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="isGrpBiz"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                           <%--  <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="prjIndCd"
                                            orgCds="${orgCds }"></ui:normalInput> --%>
                            <!-- 其他行业（租赁物用途）（重卡） -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormZK" cmpDtlCd="prjOthIndCd"
                                            orgCds="${orgCds }"></ui:normalInput>

                        </c:if>

                        <c:if test="${buOrgCd =='00000009'}">
                            <!-- 优车 -->
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
                            <!-- 代理商类型 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="agntTypCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 是否团单 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="isGrpBiz"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 租赁物用途 -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="prjIndCd"
                                            orgCds="${orgCds }"></ui:normalInput>
                            <!-- 其他行业（租赁物用途）（重卡） -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormYC" cmpDtlCd="prjOthIndCd"
                                            orgCds="${orgCds }"></ui:normalInput>
                        </c:if>

                        <c:if test="${buOrgCd =='00000014'}">
                            <!-- 轻卡 -->
                            <!-- 项目类型 -->
                            <%--<ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormLCV" cmpDtlCd="prjTypCd"--%>
                                             <%--orgCds="${orgCds }"></ui:normalSelect>--%>
                            <c:if test="${detailFlag !='true'}">
                                <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormLCV" cmpDtlCd="prjTypCd"
                                                 orgCds="${orgCds }"></ui:normalSelect>
                            </c:if>
                            <c:if test="${detailFlag =='true'}">
                                <div class="fieldBox col_33">
                                    <div class="label">项目类型</div>
                                    <div class="field">
                                        <select name="prjTypCd" id="prjTypCd" validate="{required:true}">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <c:forEach items="${prjTypCdList}" var="prjType">
                                                <option value="${prjType.key}">${prjType.value}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
                            <!-- 代理商类型 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormLCV" cmpDtlCd="agntTypCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 是否团单 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormLCV" cmpDtlCd="isGrpBiz"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 业务来源 -->
                            <ui:normalSelect pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormLCV" cmpDtlCd="bizResCd"
                                             orgCds="${orgCds }"></ui:normalSelect>
                            <!-- 其他行业（租赁物用途） -->
                            <ui:normalInput pgCd="prjBscInfoAddPage" cmpCd="prjBscInfoAddPageFormLCV" cmpDtlCd="prjOthIndCd"
                                            orgCds="${orgCds }"></ui:normalInput>
                        </c:if>

                        <div class="fieldBox col_33">
                            <div class="label">合同签署方式</div>
                            <div class="field">
                                <select name="cntTypCd" id="cntTypCd" validate="{required:true}">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${cntTypCdList}" var="cnt">
                                        <option value="${cnt.key}">${cnt.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <div class="fieldBox col_33" id="isHaveUpStructDiv" style="display: none">
                            <div class="label">是否含上装贷</div>
                            <div class="field">
                                <select name="isHaveUpStruct" id="isHaveUpStruct">
                                    <option value="  " selected="selected">--请选择--</option>
                                    <c:forEach items="${yesNoList}" var="keyValue">
                                        <option value="${keyValue.key}">${keyValue.value}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <div class="fieldBox col_33" id="cstNmDiv" style="display: none">
                            <div class="label">客户名称</div>
                            <div class="field">
                                <a href="javascript:showCstDetail()" class="link" id="cstLink">
                                    <span name="cstNm" id="cstNm">&nbsp;</span>
                                </a>
                            </div>
                        </div>
                        <div class="fieldBox col_33" id="cstMarStsDiv">
                            <div class="label">客户婚姻状态</div>
                            <div class="field">
                                <span name="cstMarStsNm" id="cstMarStsNm">&nbsp;</span>
                            </div>
                        </div>
                        <div class="fieldBox col_33" style="display: none" id="cstRlNmDiv">
                            <div class="label">客户配偶名称</div>
                            <div class="field">
                                <span name="cstRlNm" id="cstRlNm">&nbsp;</span>
                            </div>
                        </div>
                        <div class="fieldBox col_66" id="rlCstRiskDiv" style="display: none">
                            <div class="label">配偶征信：</div>
                            <div class="field">
                                <span style="color: red;" id="rlCstRisk"></span>
                            </div>
                        </div>
                        <!--  <div class="fieldBox col_33" >
                            <div class="label">征信评级</div>
                            <div class="field">
                                <span name="rskLvlCd" id="rskLvlCd">&nbsp;</span>
                              </div>
                        </div>
                        <div class="fieldBox col_33" >
                            <div class="label">客户征信结果</div>
                            <div class="field">
                                <span name="audStsDesc" id="audStsDesc">&nbsp;</span>
                              </div>
                        </div>
                           <div class="fieldBox col_33"  id="icbcAudDiv"   style="display: none">
                            <div class="label">工行征信结果</div>
                            <div class="field">
                                <span name="audStsDesc3" id="audStsDesc3">&nbsp;</span>
                              </div>
                        </div> -->

                        <div class="fieldBox col_33" id="fundRasInsNmDiv" style="display: none">
                        <div class="label">机构名称</div>
                        <div class="field" id="fundRasInsNmField">
                            <!-- <a href="javascript:showCstDetail()" class="link"> -->
                            <!--fundRasInsNm是真实机构名称,fundRasInsNmShow是添加业务线后展示的机构名称 -->
                            <span name="fundRasInsNm" id="fundRasInsNm" style="display:none"></span>
                            <span name="fundRasInsNmShow" id="fundRasInsNmShow"></span>
                            <!-- </a> -->
                            &nbsp;&nbsp;&nbsp;
                            <a id="chooseMecHref" style="color:#013d79;font-size:13px;" href="javascript:chooseMecPage()">选择机构</a>
                        </div>
                    </div>

                        <div class="fieldBox col_33" id="bkNoDiv" style="display: none">
                            <div class="label">开户银行</div>
                            <div class="field">
                                <input name="bkNo" id="bkNo" data-value="${bkNo}" placeholder="请选择" ltype="combobox" validate="">
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <div class="fieldBox col_33" id="accNoDiv" style="display: none">
                            <div class="label">银行账号</div>
                            <div class="field">
                                <input name="accNo" id="accNo" type="text" class="ui-textbox" value="${accNo}" validate="{number:true, maxlength:22, minlength:15}">
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <div class="fieldBox col_33" id="mpDiv" style="display: none">
                            <div class="label">预留手机号</div>
                            <div class="field">
                                <input name="mp" id="mp" type="text" class="ui-textbox" value="${mp}" validate="{number:true, maxlength:11, minlength:11}">
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <div class="fieldBox col_33" id="accNoWSDiv"  style="display: none">
	                            <div class="label">支付宝账号</div>
	                            <div class="field">
	                                <input name="wsAccNo" id="wsAccNo" type="text" class="ui-textbox" value="${wsAccNo}" >
	                                <span class="requiredSymbol">*</span>
	                            </div>
                        </div>
	                    <c:if test="${buOrgCd =='00000001' or buOrgCd =='00000014' or buOrgCd =='00000013'}">
                            <c:if test="${buOrgCd =='00000001' or buOrgCd =='00000014'}">
                                <div class="fieldBox col_33">
                                    <div class="label">主货物大类</div>
                                    <div class="field">
                                        <select name="mainGdsTypCd" id="mainGdsTypCd" data-value=" "  validate="{required:true}" onchange="getTripGoodsSubCd();">
                                            <option value=" " checked >请选择</option>
                                            <c:forEach items="${mainGdsTypCdList }" var="kv">
                                                <option value="${kv.key }">${kv.value }</option>
                                            </c:forEach>

                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">主运输货物</div>
                                    <div class="field">
                                        <select name="goods" id="goods" data-value=" " validate="{required:true}">
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
                            <c:if test="${buOrgCd =='00000001' or buOrgCd == '00000013'}">
                                <div class="fieldBox col_33" id="isSplMfrDiv">
                                    <div class="label">是否厂商业务</div>
                                    <div class="field">
                                        <select name="isSplMfr" id="isSplMfr" data-value=" " onchange="isShowTips()">
                                            <option value="  " selected="selected">--请选择--</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                            </c:if>
	                    </c:if>
                        <!-- 是否资管业务 -->
                        <div class="fieldBox col_33" id="isInsBizDiv">
                            <div class="label">是否资管业务</div>
                            <div class="field">
                                <select name="isInsBiz" id="isInsBiz" data-value="" >
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <div class="fieldBox col_33" id="paySchTypCdDiv">
                            <div class="label">启用支付表类型</div>
                            <div class="field">
                                <select name="paySchTypCd" id="paySchTypCd" data-value="" >
                                    <option value="" selected="selected">--请选择--</option>
                                    <option value="WS">我司支付表</option>
                                    <option value="ZF">资方支付表</option>
                                    <option value="BF">备份支付表</option>
                                    <option value="SH">赎回支付表</option>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <!-- 重卡传统城配才展示此字段 -->

                        <div class="fieldBox col_33" id="compensatoryTypeDiv" style="display: none">
                            <div class="label">渠道担保业务类型</div>
                            <div class="field">
                                <select name="compensatoryType" id="compensatoryType" data-value="" >
                                    <c:forEach items="${compensatoryTypeList }" var="kv">
                                        <option value="${kv.key }" <c:if test="${kv.key == '0'}">selected="selected"</c:if>>${kv.value }</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <div class="fieldBox col_33" id="isBigCstWorkDiv" style="display: none">
                            <div class="label">是否大客户业务</div>
                            <div class="field">
                                <select name="isBigCstWork" id="isBigCstWork" data-value="" >
                                    <option value="1" selected="selected">是</option>
                                    <option value="0">否</option>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <div class="fieldBox col_33" id="bigCstWorkSourceDiv" style="display: none">
                            <div class="label">大客户业务来源</div>
                            <div class="field">
                                <select name="bigCstWorkSource" id="bigCstWorkSource" data-value="" >
                                    <option value=" " checked >请选择</option>
                                    <c:forEach items="${bigCstWorkSourceList }" var="kv">
                                        <option value="${kv.key }" >${kv.value }</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>

                        <div class="fieldBox col_100_auto" style="width:66.6%">
                            <div class="label">区域</div>
                            <div class="field">
                                <jsp:include page="../../system/sysRegion/region.jsp" flush="true">
                                    <jsp:param name="regionShowLvl"  value="2"/>
                                </jsp:include>
                                <span  id="isSplMfrShowDiv" style="color: red"> （厂商业务，请填写供应商所在区域）</span>
                            </div>
                        </div>
                        <div class="fieldBox col_100_auto" id="internalTransfer" style="display: none">
                            <div class="label">是否内部转让</div>
                            <div class="field">
                                <select name="isInternalTransfer" id="isInternalTransfer" data-value="">
                                    <option value=" " selected="selected">--请选择--</option>
                                    <c:forEach items="${yesNoList}" var="keyValue">
                                        <option value="${keyValue.key}">${keyValue.value}</option>
                                    </c:forEach>
                                </select>
                                <span class="requiredSymbol">*</span>
                            </div>
                        </div>
                        <c:if test="${buOrgCd =='00000009'}">
                            <div class="fieldBox col_33" id="isHomeVisitDiv">
                                <div class="label">是否家访</div>
                                <div class="field">
                                    <select name="homeVisit" id="homeVisit" data-value="" validate="{required:true}">
                                        <option value="" selected="selected">--请选择--</option>
                                        <option value="1">是</option>
                                        <option value="0">否</option>
                                    </select>
                                    <span class="requiredSymbol">*</span>
                                </div>
                            </div>
                        </c:if>
                        <c:if test="${prjTypCd == 'CDDYW'}">
                        <div class="fieldBox col_100_auto" style="width:66.6%">
                            <div class="label">车抵贷预约编号</div>
                            <div class="field">
                                <a style="cursor: pointer;" onclick="odrDetail()" class="link">
                                    <span>${odrNo}</span>
                                </a>
                            </div>
                         </div>
                        </c:if>
                         <!--  -------------------tsn------------------------------------ -->
                      <c:if test="${buOrgCd == '00000008' }">
	      		     <div class="fieldBox col_100_auto"  id="pledgeDiv"  >
	      			<div class="label">是否需要抵押</div>
	      			<div class="field">
	      			<select name="pledge" id="pledge" validate="{required:true}">
	      				 <option value="0" selected="selected">请选择</option>
                   		 <c:forEach items="${kvList}" var="pledge">
                   		 <c:choose>
                   		 	<c:when test="${pledge.key ==pledgeCd}">
                   		 	<option value="${pledge.key}" selected="selected">${pledge.value}</option>
                   		 	</c:when>
                   		 <c:otherwise>
                   		 	<option value="${pledge.key}">${pledge.value}</option>
                   		 </c:otherwise>
                   		 </c:choose>
                      </c:forEach>
	      			</select>
	      			<span class="requiredSymbol">*</span>
	      			</div>
	      		</div>
	      		</c:if>
                <!-- 经销商报单员姓名+手机号 -->
                <div class="fieldBox col_33" id="spDiv">
                    <div class="label">商家报单人员(SP)</div>
                    <div class="field">
                        <span name="sp" id="sp" >${sp}</span>
                    </div>
                </div>
	      		 <!--  -------------------tsn------------------------------------ -->
                        <div class="fieldBox col_100_auto" id="noticeDiv" style="display: none">
                            <div class="label">注意事项：</div>
                            <div class="field">
                                <span style="color: red;">请务必核查收款方信息！！！</span>
                            </div>
                        </div>

                        <!-- 征信信息 -->
                        <div class="fieldBox col_100" style="width:100%">
                            <div class="caption">
                                <span class="title">客户征信</span>
                            </div>
                            <div class="sqPanel">
                                <div id="detailGrid">
                                    <div id="ligergrid_rsk" class="sq-grid"></div>
                                </div>
                            </div>
                        </div>
                        <!-- 征信信息 -->
                        <div class="fieldBox col_100" style="width:100%; display: none" id="rlCstRskDiv">
                            <div class="sqPanel">
                                <div class="sqPanel_head inL">
                                    <span class="title" id="rlCstRskTitle">配偶征信</span>
                                </div>
                                <div class="sqPanel_body">
                                    <div id="ligergrid_rlCst_rsk" class="sq-grid"></div>
                                </div>
                            </div>
                        </div>
                        <!-- 浙商征信 -->
                        <div class="fieldset1 tabel_col clearFix" id="zsBankGridDIV" style="display: none">
				            <div class="caption">
		                        <span class="title">浙商银行征信</span>
		                    </div>
		                    <div class="fieldBox col_100_auto">
								<div id="ligergrid_zsBank" class="sq-grid"></div>
							</div>
						</div>
                        <!-- 浙商征信 -->
                        <div class="fieldset1 tabel_col clearFix" id="prjYQ" style="display: none">
				            <div class="caption">
		                        <span class="title">疫情项目可选支付表</span>
		                    </div>
		                    <div class="fieldBox col_100_auto">
								<div id="ligergrid_prjYq" class="sq-grid"></div>
							</div>
						</div>
                        <!-- 存储预筛选记录ID-->
                        <input type="hidden" id="preRouteId" name="preRouteId" class="ui-textbox" value="">
                        <!-- 存储预筛选结果ID-->
                        <input type="hidden" id="preResId" name="preResId" class="ui-textbox" value="">

                        <input type="hidden" id="cstId" name="cstId" class="ui-textbox" value="${cstId}">
                        <input type="hidden" id="addPrjPage" name="addPrjPage" class="ui-textbox" value="1">
                        <input type="hidden" id="fundRasInsId" name="fundRasInsId" class="ui-textbox" value="">
                        <input type="hidden" id="insCode" name="insCode" class="ui-textbox" value="">
                        <input type="hidden" id="certNo" class="ui-textbox" value="${certNo}">
                        <input type="hidden" id="certTypCd" class="ui-textbox" value="${certTypCd}">
                        <input type="hidden" id="certValidSDt" class="ui-textbox" value="${certValidSDt}">
                        <input type="hidden" id="certValidEDt" class="ui-textbox" value="${certValidEDt}">
                        <input type="hidden" id="cstTypCd" class="ui-textbox" value="${cstTypCd}">
                        <input type="hidden" id="fqtype" class="ui-textbox" value="">
                        <input type="hidden" id="calQuatPrpsId" class="ui-textbox" value="">
                        <input type="hidden" id="isSuppSplMfr" class="ui-textbox" value="">
                    </div>
                    <!-- hide data -->
                    <div class="fieldBox col_100" style="display:none;">
                        <div class="field">
                            <input name="prjId" id="prjId" type="hidden" class="ui-textbox" value="${id}">
                            <input name="cstMgrOrgCd" id="cstMgrOrgCd" type="hidden" class="ui-textbox"
                                   value="${cstMgrOrgCd}">
                        </div>
                    </div>
                    <div class="btnsBox">
                        <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjBscInfo" pInstId="${pInstId}">
                            <span id="savePrjBscInfoBtn" class="sq-button sq-button-round" onclick="savePrjBscInfo()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
                            <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
                        </sys:FlowFrmAth>
                    </div>
                </form>
            </div>
            <%--二手车交易贷/内转交易贷/车抵贷线下，展示预审信息tab页--%>
            <c:if test="${ prjTypCd=='CDDYWUL' || prjTypCd=='OWNJYD' || prjTypCd=='ESCJYD'}" >
                <div tabid="tabH" title="预审信息" id="tabHId" style="display: none;">
                    <iframe frameborder="0" name="tabH" id="tabH" src=""></iframe>
                </div>
            </c:if>
            <div tabid="tabP" title="资管机构筛选" id="tabPId" style="display: none;">
                <iframe frameborder="0" name="tabP" id="tabP" src=""></iframe>
            </div>
            <div tabid="tabB" title="项目产品" id="tabBId" style="display: none;">
                <iframe frameborder="0" name="tabB" id="tabB" src=""></iframe>
            </div>
            <div tabid="tabC" title="资信信息" id="tabCId" style="display: none;" prjId="" cstId="">
                <iframe frameborder="0" name="tabC" id="tabC" src="" prjId="" cstId=""></iframe>
            </div>

            <!--   <div tabid="tabD" title="担保人资信信息" id="tabDId" style="display: none;" prjId="" cstId="">
             	 <iframe frameborder="0" name="tabD" id="tabD" src="" prjId="" cstId=""></iframe>
             </div> -->
            <div tabid="tabE" title="报价方案" id="tabEId" style="display: none;">
                <iframe frameborder="0" name="tabE" id="tabE" src=""></iframe>
            </div>
            <div tabid="tabF" title="支付表" id="tabFId" style="display: none;">
                <iframe frameborder="0" name="tabF" id="tabF" src=""></iframe>
            </div>
            <div tabid="tabG" title="产品明细" id="tabGId" style="display: none;">
                <iframe frameborder="0" name="tabG" id="tabG" src=""></iframe>
            </div>
            <div tabid="tabK" title="项目资料" id="tabKId" style="display: none;">
                <iframe frameborder="0" name="tabK" id="tabK" src=""></iframe>
            </div>
            <div tabid="tabL" title="合同信息" id="tabLId" style="display: none;">
                <iframe frameborder="0" name="tabL" id="tabL" src=""></iframe>
            </div>
            <c:if test="${flowCheckStsCd != '1'}">
                <div tabid="tabM" title="${sysInsTabCfgVO!=null?sysInsTabCfgVO.title:''}" id="tabMId" style="display: none;">
                    <iframe frameborder="0" name="tabM" id="tabM" src=""></iframe>
                </div>
            </c:if>
            <div tabid="tabN" title="保险分期" id="tabNId" style="display: none;">
                <iframe frameborder="0" name="tabN" id="tabN" src=""></iframe>
            </div>
            <div tabid="tabO" title="资方审核记录" id="tabOId" style="display: none;">
                <iframe frameborder="0" name="tabO" id="tabO" src=""></iframe>
            </div>
            <c:if test="${buOrgCd == '00000001' || buOrgCd == '00000008'}">
                <div tabid="tabQ" title="CDS决策引擎" id="tabQId" style="display: none;">
                    <iframe frameborder="0" name="tabQ" id="tabQ" src=""></iframe>
                </div>
            </c:if>
            <sys:resourceAuth resCd="prjRskAudWarnRecorder">
                <div tabid="tabR" title="项目风险审核记录" id="tabRId" style="display: none;">
                    <iframe frameborder="0" name="tabR" id="tabR" src=""></iframe>
                </div>
            </sys:resourceAuth>

        </div>
        <!-- 流程使用开始 -->
        <input name="preTaskIdsNm" id="preTaskIds" type="text" style="display: none;" value="${preTaskIds}"/>
        <input name="pInstIdNm" id="pInstId" type="text" style="display: none;" value="${pInstId}"/>
        <!-- 流程使用结束-->
    </div>
</div>
<form id="confirm_form" style="display: none;">
    <div class="fieldset1 clearFix">
        <div class="fieldBox">
            <p>按此修改机构信息将会：</p>
            <p>1.删除现有报价及支付表</p>
            <p>2.删除银行卡信息和资方开户信息</p>
            <p>确定修改吗？</p>
            <br>
        </div>
    </div>
</form>
<div id="chooseInsList" style="display: none">
    <div id="chooseInsList_div"></div>
</div>
<script type="text/javascript">
    var pageInApp = {
        flag: true
    };
    <%--var preStrCheckFlag = '${preStrCheckFlag}'; --%> //预筛选规则强校验flag
    var prjTypCdAllowedList = '${prjTypCdAllowedList}';//当前事业部下支持预筛选的项目类型list
    //预筛选强校验关联项目类型
    var prjTypCdAllowedMapJSON = [];
    <c:if test="${not empty prjTypCdAllowedMap}"> prjTypCdAllowedMapJSON = ${prjTypCdAllowedMap}; </c:if>

    var preRouteInsNm = '${preRouteInsNm}';//预筛选机构名称
    var preRouteIdOld = '${preRouteIdOld}';
    var preResIdOld = '${preResIdOld}';
    $("#chooseMecHref").hide();//默认隐藏

    var arrFoundCode = [];
    <c:forEach items="${friBaseList}" var= "module">
    var item  = {"fundRasInsId":"${module.id}","fundRasInsNmShow":"${module.fundRasInsNmShow}"};
    arrFoundCode.push(item);
    </c:forEach>

    var fundRasInsId = '${fundRasInsId}';//金融机构ID
    var fundRasInsNmTextShow = "";

    var _isInitPage_flag = false;
    var prjId = '${id}';
    var bizModCd = '${bizModCd}';
    var prjTypCd = '${prjTypCd}';
    var cstMgrId = "";
    var selectOrgCd = "";
    var searchOrgTree = null;
    var firstNode = null;
    var currOrgId = '${currOrgId}';
    var textName = '${orgTextName}';//节点名称
    var orgData = null;
    var id = "";//初始值
    var detailFlag = '${detailFlag}';
    var cstTypCd = '${cstTypCd}';
    var audStsCd = '${audStsCd}'; //项目流程审核状态(SYS0019)
    var flowCheckStsCd = '${flowCheckStsCd}';
    // 信审初审节点flag
    var fromCAFlag = '${fromCAFlag}';
    // 客户经理修改flag
    var fromCMFlag = '${fromCMFlag}';
    var isFlow = '${isFlow}';
    var ywParam = '${ywParam}';
    var buOrgCd = '${buOrgCd}';
    var showTabs = '${showTabs}';
    var currOrg = '${currOrg}';
    var beforeCstId = null; //之前的客户id
    var beforePrjTypCd = null;//之前的项目类型
    var isChkFlag = null;
    var isMateRskLvlCdIsC = null;//承租人（男）是否存在配偶（女性）征信级别为C【0-不存在 1-存在】
    var isSplMfr = '${isSplMfr}';
    var isInsBiz = '${isInsBiz}';
    var homeVisit = '${homeVisit}';
    //支付表类型(支付表开启)
    var paySchTypCd = '${paySchTypCd}';
    var prjTypMdfFlag = '${prjTypMdfFlag}';
    var mainData;
    var rtnMsg="1";
    var routeMsg="1";
    var routeCheck = '${routeCheck}';
    var insCodeCheck = "";
    var firstCheck = false;
    var compensatoryType = '${compensatoryType}';
    var isBigCstWork = '${isBigCstWork}';
    var dsCd = '${dsCd}';
    $("#pledgeDiv").hide();
    if(buOrgCd == "00000008"){//只有专车事业部显示是否需要抵押字段
   	 $("#pledgeDiv").show();
    }else{
    	 $("#pledge").attr("validate", "");
    }
    if(buOrgCd == "00000001" || buOrgCd == "00000008"){//重卡事业部才显示cds决策引擎
        $("#tabQId").show();
    }else {
        $("#tabQId").hide();
    }
    if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK && (prjTypCd == "CPYW" || prjTypCd == "CTYW")){
        $("#compensatoryTypeDiv").show();
    }
    var prjTypCdVal = $('#prjTypCd').val();
    console.log(prjTypCdVal + '111')
    if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK && (prjTypCdVal == "CPYW" || prjTypCdVal == "CTYW")){
        $("#compensatoryTypeDiv").show();
    }
    $("#isSplMfrDiv").hide();
    $("#isSplMfrShowDiv").hide();
    $("#isHomeVisitDiv").hide();
    $("#spDiv").hide();

    //疫情项目可选支付表 当前选中的项目ID
    var cruChePrjId = null;
    var checkboxYQ = true;
    var insList = [];
    //var insListCfgJSON = [];
    <%-- <c:if test="${not empty insListCfg}"> insListCfgJSON = ${insListCfg}; </c:if> --%>
    if (detailFlag == "true") {
        checkboxYQ = false;
    }
    //是否第一次初始
    var nonInitialYQ = true;
    $(function () {
        initTab();
        var prjTypCd = $("#prjTypCd").val();
        //修改页面 二手车 项目类型不可修改
        console.log(prjTypMdfFlag);
        console.log(prjTypCd);
        console.log(cstTypCd);
        if(prjTypMdfFlag == "0"){
            liger.get("prjTypCd").setDisabled(true);
        }
        if(isBigCstWork == '1' &&  dsCd == 'CHL0047'){
            console.log("ssssss")
            liger.get("prjTypCd").setDisabled(true);
            liger.get("isSplMfr").setDisabled(true);
            liger.get("isBigCstWork").setDisabled(true);
            liger.get("bigCstWorkSource").setDisabled(true);
            //liger.get("cstLink").setDisabled(true);
            $("#cstLink").attr("disabled",true);
        }
        if(prjTypCd == "ESCJYD" || prjTypCd == "CDDYWUL"|| prjTypCd == "OWNJYD"){
            //修改页面 二手车 项目类型不可修改，发票类型根据客户类型锁死
            if(detailFlag == "false"){
                var selectid= $("#cntTypCd").ligerGetComboBoxManager();
                //自然人默认为电子
                if(cstTypCd == "1"){
                    $("#cntTypCd").val("1");
                }else if(cstTypCd == "2"){
                    //法人默认为纸质
                    $("#cntTypCd").val("2");
                }
                selectid.setValue($("#cntTypCd").val());
                selectid.setText($("#cntTypCd").find(":selected").text());
                liger.get("cntTypCd").setDisabled(true);
            }

        }
        var cstId = $("#cstId").val();
        /* if(prjTypCd&&cstId){
         queryCstCreditiInvest();
         } */
        //项目详情页面显示启用支付表类型
        var selectIsOpenId= $("#paySchTypCd").ligerGetComboBoxManager();
        selectIsOpenId.setValue(paySchTypCd);
        liger.get("paySchTypCd").setDisabled(true);

        if ((buOrgCd == "00000001" && (prjTypCd == "CPYW" || prjTypCd == "CTYW" ||prjTypCd == "DSFZGCP"||prjTypCd == "DSFZGCT"))
            || (buOrgCd == "00000013" && prjTypCd == "CPYW")) {
            $("#isSplMfrDiv").show();
            var selectid= $("#isSplMfr").ligerGetComboBoxManager();
            if (isSplMfr==0) {
                selectid.setValue(isSplMfr);
                selectid.setText("否");
                $("#isSplMfrShowDiv").hide();
            } else if (isSplMfr==1) {
                selectid.setValue(isSplMfr);
                selectid.setText("是");
                $("#isSplMfrShowDiv").show();
            }
        } else {
            $("#isSplMfrDiv").hide();
        }
        if ((buOrgCd == "00000009")&& (prjTypCd == "CDDYWUL" || prjTypCd =="ESCJYD" || prjTypCd =="CDDYWYQ" || prjTypCd =="OWNJYD")){
            $("#isHomeVisitDiv").show();
            var selectid = $("#homeVisit").ligerGetComboBoxManager();
            if(prjTypCd =="CDDYWYQ"){
                selectid.setValue(0);
                selectid.setText("否");
            }else{
                if (homeVisit == 1){
                    selectid.setValue(homeVisit);
                    selectid.setText("是");
                } else if (homeVisit == 0){
                    selectid.setValue(0);
                    selectid.setText("否");
                }
            }
        } else {
            $("#isHomeVisitDiv").hide();
        }
        if (prjTypCd == "LCV") {
            $("#spDiv").show();
        } else {
            $("#spDiv").hide();
        }

        /**
        if(insListCfgJSON != null){
            for(var i=0;i<insListCfgJSON.length;i++){
                var ptd = insListCfgJSON[i].prjTypCd;
                if(prjTypCd == insListCfgJSON[i].prjTypCd){
                    liger.get("isInsBiz").setEnabled();
                    break;
                }else{
                    liger.get("isInsBiz").setDisabled(true);
                }
            }
        }else{
            liger.get("isInsBiz").setDisabled(true);
        }
        */

        //是否资管业务,设置不可修改
        liger.get("isInsBiz").setDisabled(true);
        var selectid= $("#isInsBiz").ligerGetComboBoxManager();
        if (1 == isInsBiz) {
            selectid.setValue(isInsBiz);
            selectid.setText("是");
        } else {
            selectid.setValue(0);
            selectid.setText("否");
        }

        // // 疫情项目显示选择支付表列表
        // if (prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWYQ) {
        //     queryPrjPaySchYQInfo();
        //     $("#prjYQ").show();
        // } else {
        //     $("#prjYQ").hide();
        // }
        $("#isInsBiz").change(function (){
            if($("#isInsBiz").val() == CommonConstant.C_YN_Y){
                prjTypCd = $("#prjTypCd").val();
                /**
                if(insListCfgJSON != null || !(insListCfgJSON.length > 0)){
                    for(var i=0;i<insListCfgJSON.length;i++){
                        if(prjTypCd == insListCfgJSON[i].prjTypCd){
                            insList = insListCfgJSON[i].insList;
                            showInsList();
                        }
                    }
                }
                */
            }else{
                $("#fundRasInsNmDiv").hide();
                $("#fundRasInsNm").html(selectedRows[0].insNm);
                fundRasInsNmTextShow = selectedRows[0].insNm;
                if(arrFoundCode){
                    for (var i=0;i<arrFoundCode.length;i++) {
                        if(arrFoundCode[i].fundRasInsId == selectedRows[0].insId){
                            fundRasInsNmTextShow = arrFoundCode[i].fundRasInsNmShow;
                            break;
                        }
                    }
                }
                $("#fundRasInsNmShow").html(fundRasInsNmTextShow);
                $("#fundRasInsId").val(selectedRows[0].insId);
                $("#insCode").val(selectedRows[0].insCode);
            }
        });

        //编辑项目，反显预筛选信息
        var prePrjTypCd = $("#prjTypCd").val();
        if(prjTypCdAllowedList != ""){
            if(prjTypCdAllowedList.indexOf(prePrjTypCd) != -1){
                $("#fundRasInsNmDiv").show();
                $("#chooseMecHref").show();
                $("#fundRasInsNm").html(preRouteInsNm);
                fundRasInsNmTextShow = preRouteInsNm;
                if (fundRasInsId && ("" + fundRasInsId).trim()) {
                    if(arrFoundCode){
                        for (var i=0;i<arrFoundCode.length;i++) {
                            if(arrFoundCode[i].fundRasInsId == fundRasInsId){
                                fundRasInsNmTextShow = arrFoundCode[i].fundRasInsNmShow;
                                break;
                            }
                        }
                    }
                }
                $("#fundRasInsNmShow").html(fundRasInsNmTextShow);
                $("#preRouteId").val(preRouteIdOld);
                $("#preResId").val(preResIdOld);
            }
        }

        $("#isBigCstWork").change(function () {
            var isBigCstWork = $("#isBigCstWork").val();
            var form = liger.get("prj_bsc_info_form");
            if(isBigCstWork == "0"){
                $("#bigCstWorkSourceDiv").hide();
                form.setData({
                    bigCstWorkSource: " ",
                });
            }else{
                $("#bigCstWorkSourceDiv").show();
            }
        });

        $("#prjTypCd").change(function (){
            var prjTypCdVal = $(this).val();
            var cstId = $("#cstId").val();
            //清空预筛选信息
            $("#preRouteIdOld").val("");
            $("#preRouteId").val("");
            $("#preResId").val("");
            //清空机构信息
            $("#fundRasInsNm").html("");
            $("#fundRasInsNmShow").html("");
            $("#fundRasInsId").val("");
            $("#insCode").val("");
            //清空厂商信息
            $("#isSplMfr").val("");
            $("#calQuatPrpsId").val("");//报价器id
            //修改项目类型
            if(prjTypCdAllowedList != ""){
                if(prjTypCdAllowedList.indexOf(prjTypCdVal) != -1){
                    $("#fundRasInsNmDiv").show();
                    $("#chooseMecHref").show();
                }else{
                    console.log("hide prjTypCdVal:"+prjTypCdVal);
                    $("#fundRasInsNmDiv").hide(1);
                    $("#chooseMecHref").hide(1);
                }
            }

            if (prjTypCdVal == "CDDYW") {
                $.ligerDialog.SQalert({content: "暂不支持新增车抵贷业务.", SQ_type: "warning"});
                return;
            }
            /**
            if(insListCfgJSON != null || !(insListCfgJSON.length > 0)){
                for(var i=0;i<insListCfgJSON.length;i++){
                    if(prjTypCdVal == insListCfgJSON[i].prjTypCd){
                        liger.get("isInsBiz").setEnabled();
                        break;
                    }else{
                        liger.get("isInsBiz").setDisabled(true);
                    }
                }
            }else{
                liger.get("isInsBiz").setDisabled(true);
            }
            */
            /*if(ProjectConstant.CODE_BU_ORG_CD_ZK == buOrgCd && (ProjectConstant.PRJ_TYP_CD_CDDYWUL == prjTypCd || ProjectConstant.PRJ_TYP_CD_ESCJYD == prjTypCd)){
                liger.get("isInsBiz").setEnabled();
            }else{
                liger.get("isInsBiz").setDisabled(true);
            }*/
            //重卡传统城配展示代偿担保账户
            console.log(buOrgCd + '222');
            console.log(prjTypCdVal + '333');
            if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK && (prjTypCdVal == "CPYW" || prjTypCdVal == "CTYW")){
                $("#compensatoryTypeDiv").show();
            }else{
                $("#compensatoryTypeDiv").hide();
            }
            if ((buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK && (prjTypCdVal == "CPYW" || prjTypCdVal == "CTYW"||prjTypCdVal == "DSFZGCP"||prjTypCdVal == "DSFZGCT"))
                || (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && prjTypCdVal == 'CPYW')) {
                $("#isSplMfrDiv").show();
            } else {
                $("#isSplMfrDiv").hide();
            }
            if(buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK || buOrgCd == ProjectConstant.CODE_BU_ORG_CD_YC){
                if (prjTypCdVal == "CDDYWUL") {
                    var selectid= $("#bizTypCd").ligerGetComboBoxManager();
                    $("#bizTypCd").val("3");
                    selectid.setValue($("#bizTypCd").val());
                    selectid.setText($("#bizTypCd").find(":selected").text());
                }
                if (prjTypCdVal == "ESCJYD" || prjTypCdVal == "OWNJYD") {
                    var selectid= $("#bizTypCd").ligerGetComboBoxManager();
                    $("#bizTypCd").val("4");
                    selectid.setValue($("#bizTypCd").val());
                    selectid.setText($("#bizTypCd").find(":selected").text());
                }
                if (prjTypCdVal != "CDDYWUL" && prjTypCdVal != "ESCJYD" && prjTypCdVal !="OWNJYD") {

                    var selectid= $("#bizTypCd").ligerGetComboBoxManager();
                    $("#bizTypCd").val("");
                    selectid.setValue($("#bizTypCd").val());
                    selectid.setText($("#bizTypCd").find(":selected").text());
                }
            }
            if(buOrgCd != ProjectConstant.CODE_BU_ORG_CD_YC){
                if (prjTypCdVal == "DSFZGCP" || prjTypCdVal == "DSFZGCT") {
                    var selectid= $("#bizTypCd").ligerGetComboBoxManager();
                    $("#bizTypCd").val("4");
                    selectid.setValue($("#bizTypCd").val());
                    selectid.setText($("#bizTypCd").find(":selected").text());

                    var selectid= $("#cntTypCd").ligerGetComboBoxManager();
                    $("#cntTypCd").val("1");
                    selectid.setValue($("#cntTypCd").val());
                    selectid.setText($("#cntTypCd").find(":selected").text());
                }
            }
            if(prjTypCdVal == "ESCJYD" || prjTypCdVal == "CDDYWUL"|| prjTypCdVal == "OWNJYD"){
                liger.get("bizTypCd").setDisabled(true);
            }else{
                liger.get("bizTypCd").setEnabled(true) ;
            }
            //第三方项目转普通项目时提示语
            if ((prjId != "" && ( prjTypCd == "DSFZGCT" || prjTypCd == "DSFZGCP" ))
                || (isInsBiz == "1" && (prjTypCd == "CPYW" && buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY))) {
              	/* prompt(); */
          		$.ligerDialog.confirm("按此修改项目类型将会：删除现有报价及支付表；删除银行卡信息和资方开户信息；确定修改么？", function (flag) {
        			if(flag == false) {
        				setPrjTypCd();
        			}
        			else {
        				changePrjTypCd(prjTypCdVal);
        			}
            	});
            }else {
				changePrjTypCd(prjTypCdVal);
	        }

            if (prjTypCd == "LCV") {
                $("#spDiv").show();
            } else {
                $("#spDiv").hide();
            }
            if (prjTypCdVal == "ESCJYD"){
                $("#internalTransfer").show() ;
            }else{
                $("#internalTransfer").hide() ;
            }
        });
        $("#cstNm").change(function () {
            queryCstCreditiInvest();
        });
        if(buOrgCd == "00000008"){
            liger.get("pledge").setDisabled(true);
            $("#rgnProvCd").change(function () {
                var rgnProvCd=getRgnProvCd();
                if('0014'==rgnProvCd){
                	var selectid= $("#pledge").ligerGetComboBoxManager();
                	$("#pledge").val("2");
                	selectid.setValue($("#pledge").val());
                	selectid.setText($("#pledge").find(":selected").text());
                }else if (""==rgnProvCd){
                	var selectid= $("#pledge").ligerGetComboBoxManager();
                	$("#pledge").val("0");
                	selectid.setValue($("#pledge").val());
                	selectid.setText($("#pledge").find(":selected").text());
                }else{
                	var selectid= $("#pledge").ligerGetComboBoxManager();
                	$("#pledge").val("1");
                	selectid.setValue($("#pledge").val());
                	selectid.setText($("#pledge").find(":selected").text());
                }
            });
        }

        $("#isSplMfr").change(function () {
            var prjTypCd = $("#prjTypCd").val();
            var isSplMfrValue = $("#isSplMfr").val();//
            if(isSplMfrValue=="1" && (buOrgCd !== ProjectConstant.CODE_BU_ORG_CD_XNY || prjTypCd !== ProjectConstant.PRJ_TYP_CD_CPYW)){//是选择报价器
                chooseMfrQuatPage();
            }
            if(isSplMfrValue=="0"){
                //否删除方案
                    $.ligerDialog.confirm("修改是否厂商为否时将会：删除现有报价及支付表；确定修改么？", function (flag) {
                        var selectid= $("#isSplMfr").ligerGetComboBoxManager();
                        if(flag == false) {
                            $("#isSplMfr").val('1');
                            selectid.setValue(1);
                            selectid.setText("是");
                        }else{
                            $("#isSplMfr").val('0');
                            selectid.setValue(0);
                            selectid.setText("否");
                            $("#calQuatPrpsId").val("");
                            $("#isSplMfrShowDiv").hide();
                        }
                    });
            }

        });
    });
    var liger_insList;
    function showInsList(){
        liger_insList.loadData({Rows:insList});
        $.ligerDialog.SQopen({
            width: 800,
            top: 100,
            buttons: [
                {
                    text: "确定", cls: 'l-dialog-btn-ok', onclick:function(){
                        checkIn();
                    }
                }, {
                    text: "取消", cls: 'l-dialog-btn-no', onclick:function(){
                        checkOut();
                        $.ligerDialog.hide();
                    }
                }
            ],
            title : '机构列表',
            target: $("#chooseInsList")
        });
    }
    function checkIn(){
        var selectedRows = liger_insList.getSelectedRows();
        if (selectedRows.length != 1) {
            top.$.ligerDialog.SQalert({content: "请选择一家资方", SQ_type: "error"});
            return false;
        }
        $("#fundRasInsNmDiv").show();
        $("#fundRasInsNm").html(selectedRows[0].insNm);
        fundRasInsNmTextShow = selectedRows[0].insNm;
        if (selectedRows[0].insId && ("" + selectedRows[0].insId).trim()) {
            if(arrFoundCode){
                for (var i=0;i<arrFoundCode.length;i++) {
                    if(arrFoundCode[i].fundRasInsId == selectedRows[0].insId){
                        fundRasInsNmTextShow = arrFoundCode[i].fundRasInsNmShow;
                        break;
                    }
                }
            }
        }
        $("#fundRasInsNmShow").html(fundRasInsNmTextShow);
        $("#fundRasInsId").val(selectedRows[0].insId);
        $("#insCode").val(selectedRows[0].insCode);
        if($("#cstTypCd").val() == ProjectConstant.CST_TYP_CD_LP){
            var form = liger.get("prj_bsc_info_form");
            if(selectedRows[0].insCode == ProjectConstant.PRJ_INS_CODE_CCBANKTB){
                form.setData({
                    cntTypCd: 1,
                });
            }else{
                form.setData({
                    cntTypCd: 2,
                });
            }
        }

        $.ligerDialog.hide();
    }

    function checkOut(){
        var selectid= $("#isInsBiz").ligerGetComboBoxManager();
        selectid.setValue(0);
        selectid.setText("否");
        $("#fundRasInsNmDiv").hide();
        $("#fundRasInsNm").html("");
        $("#fundRasInsNmShow").html("");
        $("#fundRasInsId").val("");
        $("#insCode").val("");
    }

    liger_insList = $("#chooseInsList_div").ligerGrid({
        data:insList,
        dataAction:'local',
        columns: [
            {
                display: '机构名称', name: 'insNmShow', minWidth: 600,
                editable: false
            }
        ],
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: true,
        frozen: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false,
        fixedCellHeight: false,
        usePager: false,
        onAfterShowData: function () {
            SetIframe_height();
        }
    });

    function changePrjTypCd( prjTypCdVal ) {
        //普通项目转第三方项目提示语
        /*if () {
            chooseFundPage();
        } else {

        }*/
        var selectid= $("#isInsBiz").ligerGetComboBoxManager();
        selectid.setValue(0);
        selectid.setText("否");
        $("#fundRasInsNmDiv").hide();
        $("#fundRasInsNm").html("");
        $("#fundRasInsNmShow").html("");
        $("#fundRasInsId").val("");
        $("#insCode").val("");
        $("#wsAccNo").attr("validate", "");
        $("#accNoWSDiv").hide();

        /**
        if(insListCfgJSON != null || !(insListCfgJSON.length > 0)){
            for(var i=0;i<insListCfgJSON.length;i++){
                if(prjTypCdVal == insListCfgJSON[i].prjTypCd){
                    liger.get("isInsBiz").setEnabled();
                    break;
                }else{
                    liger.get("isInsBiz").setDisabled(true);
                }
            }
        }else{
            liger.get("isInsBiz").setDisabled(true);
        }
        */
        /*if((ProjectConstant.CODE_BU_ORG_CD_ZK == buOrgCd && (ProjectConstant.PRJ_TYP_CD_CPYW == prjTypCdVal|| ProjectConstant.PRJ_TYP_CD_CTYW == prjTypCdVal))
                || (ProjectConstant.CODE_BU_ORG_CD_XNY == buOrgCd && ProjectConstant.PRJ_TYP_CD_CPYW == prjTypCdVal)
                || (ProjectConstant.CODE_BU_ORG_CD_ZC == buOrgCd && ProjectConstant.PRJ_TYP_CD_KCYW == prjTypCdVal)){
            //pageInTab.removeTabItem("tabP");
            /!*$("#tabPId").show();*!/
            liger.get("isInsBiz").setDisabled(true);
        }else{
            if(ProjectConstant.CODE_BU_ORG_CD_ZK == buOrgCd && (ProjectConstant.PRJ_TYP_CD_CDDYWUL == prjTypCdVal || ProjectConstant.PRJ_TYP_CD_ESCJYD == prjTypCdVal)){
                liger.get("isInsBiz").setEnabled();
            }
            if(ProjectConstant.CODE_BU_ORG_CD_YC == buOrgCd && (ProjectConstant.PRJ_TYP_CD_ESCJYD == prjTypCdVal)){
                liger.get("isInsBiz").setEnabled();
            }
        }*/
        // 新能源 并且选择了
        if(ProjectConstant.PRJ_TYP_CD_CDDYWYQ == prjTypCdVal){
            if(ProjectConstant.CODE_BU_ORG_CD_XNY == buOrgCd){
                $.ligerDialog.SQalert({content: "新能源事业部暂不支持车抵贷YQ项目.", SQ_type: "warning"});
                return;
            }
            var cstIdVal = $("#cstId").val();
            //如果yq项目没有选择客户 提示先选择客户
            if(cstIdVal == ''){
                $.ligerDialog.SQalert({content: "请选择客户", SQ_type: "warning"});
                return;
            }
        }else{
            $("#prjYQ").hide();
        }
        if (prjTypCdVal && cstId) {
            queryCstCreditiInvest();
        }
        if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK && prjTypCdVal == "CPYW" && ProjectConstant.PRJ_INS_CODE_ICBC == $("#insCode").val()) {
            $("#isHaveUpStructDiv").show();
        } else {
            $("#isHaveUpStructDiv").hide();
        }

        //修改项目类型
        if(prjTypCdAllowedList != ""){
            //修改项目类型，清空预筛选信息
            //$("#fundRasInsNm").html("");
            //$("#preRouteId").val("");
            //$("#preResId").val("");
            if(prjTypCdAllowedList.indexOf(prjTypCdVal) != -1){
                $("#fundRasInsNmDiv").show();
                $("#chooseMecHref").show();
            }else{
                $("#fundRasInsNmDiv").hide(1);
                $("#chooseMecHref").hide(1);
            }
        }
    }
    var localTabs = ["tabA", "tabB", "tabC", "tabE", "tabF", "tabG", "tabK", "tabL", "tabM", "tabN" ,"tabO" ,"tabQ", "tabR", "tabH"];
    function initData() {
        initPrjIndTree();
        initOrgTree();
        //初始化银行列表
        $("#bkNo").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            autocomplete: function (e) {
                filter_autoComboboxData(e.key, this);
                e.show();
            },
        });
        $("#prj_bsc_info_form").ligerForm({
            validate: true
        });
        var ligerForm = liger.get("prj_bsc_info_form");
        liger.get("bkNo").setData(${bankList});
        liger.get("bkNo").updateStyle();
        $("#prj_bsc_info_form").check_ligerFormEditor();
        var fromPrjFlag = '${fromPrjFlag}';
        if (fromPrjFlag && fromPrjFlag == 'true') {
            if (!isFlow || "0" == isFlow) {
                $("#chooseCstDiv").show();
            } else {
                $("#chooseCstDiv").hide();
            }
        } else {
            var cstNm = '${cstNm}';
            $("#cstNm").html(cstNm);
            $("#cstNmDiv").show();
            $("#chooseCstDiv").hide();
        }
        /*  // 设置业务种类默认为禁用
         var slt=liger.get("loanTypCd");
         slt.setDisabled();
         */
        if (prjId) {
            setPrjbscInfoData();//设置选择项目的值
        } else {
            //添加时设置树为选中状态
            var form = liger.get("prj_bsc_info_form");
            var currOrg = '${currOrg}';
            var mgrFlag = '${mgrFlag}';
            var cstMgrId = "";
            if (mgrFlag == "true") {
                cstMgrId = '${cstMgrId}';
            }
            form.setData({
                orgCd: currOrg,
                cstMgrId: cstMgrId
            });
        }
        if ("1" == isFlow) {
            $("#chooseCst").hide();
            /* if (liger.get("prjTypCd")) {
                liger.get("prjTypCd").setDisabled(true);
            } */
        }
        if (detailFlag == "true" || flowCheckStsCd == "2") {
            if (detailFlag == "true") {
                $("#savePrjBscInfoBtn").hide();
                $("#cancelBtn").hide();
            }
            //详情 设置选项为不可选
            //$("#prjNm").attr("readonly","readonly");
            $("#chooseCstDiv").hide();
            $("#chooseCst").hide();
            liger.get("orgCd").setDisabled(true);
            liger.get("cstMgrId").setDisabled(true);
            if (liger.get("isSplMfr")) {
                liger.get("isSplMfr").setDisabled(true);
            }
            /* 	liger.get("dsCd").setDisabled(true); */
            /* 	liger.get("loanTypCd").setDisabled(true); */
            if (liger.get("prjTypCd")) {
                liger.get("prjTypCd").setDisabled(true);
            }
            if (liger.get("isBigCstWork")) {
                liger.get("isBigCstWork").setDisabled(true);
            }
            if (liger.get("bigCstWorkSource")) {
                liger.get("bigCstWorkSource").setDisabled(true);
            }
            if (liger.get("cntTypCd")) {
                liger.get("cntTypCd").setDisabled(true);
            }
            if (liger.get("bizTypCd")) {
                liger.get("bizTypCd").setDisabled(true);
            }
            if (liger.get("agntTypCd")) {
                liger.get("agntTypCd").setDisabled(true);
            }
            if (liger.get("bizModCd")) {
                liger.get("bizModCd").setDisabled(true);
            }
            if (liger.get("isGrpBiz")) {
                liger.get("isGrpBiz").setDisabled(true);
            }
            if (liger.get("bizResCd")) {
                liger.get("bizResCd").setDisabled(true);
            }
            if (liger.get("investTypCd")) {
                liger.get("investTypCd").setDisabled(true);
            }
            if (liger.get("insSol")) {
                liger.get("insSol").setDisabled(true);
            }
            if (liger.get("refereeTel")) {
                liger.get("refereeTel").setDisabled(true);
            }
            if (liger.get("purpose")) {
                liger.get("purpose").setDisabled(true);
            }
            if (liger.get("repayWay")) {
                liger.get("repayWay").setDisabled(true);
            }
            if (liger.get("guarMsr")) {
                liger.get("guarMsr").setDisabled(true);
            }
            if (liger.get("deductWayCd")) {
                liger.get("deductWayCd").setDisabled(true);
            }
            if ($("#othLsDesc")) {
                $("#othLsDesc").attr("readonly", "readonly");
            }
            if (liger.get("rgnProvCd")) {
                liger.get("rgnProvCd").setDisabled(true);
            }
            if (liger.get("rgnCityCd")) {
                liger.get("rgnCityCd").setDisabled(true);
            }
            if ($("#prjRem")) {
                $("#prjRem").attr("readonly", "readonly");
            }
            if (liger.get("rgnCityCd")) {
                liger.get("rgnCityCd").setDisabled(true);
            }
            if (liger.get("prjIndCd")) {
                liger.get("prjIndCd").setDisabled(true);
            }
            if (liger.get("prjOthIndCd")) {
                liger.get("prjOthIndCd").setDisabled(true);
            }
            if (liger.get("buyType")) {
                liger.get("buyType").setDisabled(true);
            }
            if (liger.get("prjIndCdZc")) {
                liger.get("prjIndCdZc").setDisabled(true);
            }
            if (liger.get("prjIndCdXny")) {
                liger.get("prjIndCdXny").setDisabled(true);
            }
            if (liger.get("isHaveUpStruct")) {
                liger.get("isHaveUpStruct").setDisabled(true);
            }
            if (liger.get("homeVisit")) {
                liger.get("homeVisit").setDisabled(true);
            }
            if (liger.get("compensatoryType")) {
                liger.get("compensatoryType").setDisabled(true);
            }
            liger.get("bkNo").setDisabled(true);
            liger.get("accNo").setDisabled(true);
            liger.get("mp").setDisabled(true);
            if(liger.get("wsAccNo")){
            liger.get("wsAccNo").setDisabled(true);
            }
            if (liger.get("mainGdsTypCd")) {
                liger.get("mainGdsTypCd").setDisabled(true);
            }
            if (liger.get("goods")) {
                liger.get("goods").setDisabled(true);
            }
            if(liger.get("isInternalTransfer")){
                liger.get("isInternalTransfer").setDisabled(true);
            }
        }
        changeSelectSun(0);
        var prjTypCd = $("#prjTypCd").val();
        if (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_ZK && prjTypCd == "CPYW" && ProjectConstant.PRJ_INS_CODE_ICBC == $("#insCode").val()) {
            $("#isHaveUpStructDiv").show();
        } else {
            $("#isHaveUpStructDiv").hide();
        }
        if ($("#insCode").val()==="czbank"){
            $("#bkNoDiv").show();
            $("#accNoDiv").show();
            $("#mpDiv").show();
        }
        /*if ($("#insCode").val()==="icbc"){
      	  $("#isHaveUpStructDiv").show();
        }*/
        if ($("#insCode").val()==="alipay"){
        	 $("#accNoWSDiv").attr("validate", "{required:true}");
            $("#accNoWSDiv").show();
        }else{
        	  var ligerForm = liger.get("prj_bsc_info_form");

        	  /*  ligerForm.setFieldValidate("wsAccNo", {
                   required: true,
                   input: false
               }); */
        	$("#wsAccNo").attr("validate", "");
        	 $("#accNoWSDiv").hide();
        }

        if ("1" == isFlow) {
        	if ($("#prjTypCd")) {
		        var currPrjTypCd = $("#prjTypCd").val();
		        $("#prjTypCd option").each(function(){
		        	// 如果当前选择的是“第三方资管城配”或者是“城配业务”，那么只保留“第三方资管城配”和“城配业务”
		        	if("DSFZGCP" == currPrjTypCd || "CPYW" == currPrjTypCd) {
		        		if("DSFZGCP" != $(this).val() && "CPYW" != $(this).val()) {
		        			$(this).remove();
		        		}
		        	}
		        	// 如果当前选择的是其他，那么移除“第三方资管城配”和“城配业务”
		        	else if( ("DSFZGCP" == $(this).val() || "CPYW" == $(this).val()) ) {
		        		$(this).remove();
		        	}
		        });
	        	if(liger.get("prjTypCd")) {
	        		liger.get("prjTypCd").setSelect();
	        	}
	        }
        }
        if(prjTypCd == "ESCJYD"){
            $("#internalTransfer").show();
        }else{
            $("#internalTransfer").hide();
        }
    }


    var pageInTab = null;
    var loadedTabs = [];
    //获取当前组织机构及其父级节点名称
    function changeSelectOrgCd() {
        //选中了客户经理，设置客户经理的组织机构
        var mgrOrg = $("#cstMgrId").find("option:selected").attr("cstMgrOrgCd");
        //添加时设置树为选中状态
        var form = liger.get("prj_bsc_info_form");
        form.setData({
            orgCd: mgrOrg,
        });
    }


  //主货物大类change事件
    function getTripGoodsSubCd(){
    	var _PCode = $("#mainGdsTypCd").val();//获取主货物大类的value
    	if(!_PCode) return;
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		data:{PCode:_PCode},
    		/* 获取货品下拉框的数据 */
    		url: '<%=path%>/audit/audCreditInfo/getGoodsTypJSON.do',
    		success:function(msg){
    			if(msg.success == 1){
					var goodsRes = '${goodsRes}';
    				//主运输货物
    				var goods = $("#goods");
    				if(goods && goods.length && msg.data){
                        $("#goods").empty();
                        $("#goods").append("<option value=''>请选择</option>");
                        var option ="";
                        $.each(msg.data,function(index,obj) {
                            if(goodsRes == obj.key){
                                option = "<option selected='selected'  value='"+obj.key+"'>"+obj.value+"</option>";
                                $("#goods").val(obj.key);
                            }else{
                                option = "<option value='"+obj.key+"'>"+obj.value+"</option>";
                            }
                            $(option).appendTo("#goods");
                            liger.get("goods").setSelect();

                        });
    					$("#goods").add_ligerFormEditor();
    				}
    				SetIframe_height();
    			}else{
    				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
    			}
    		}
    	});
    }
    //主货物大类change事件
    function getTripGoodsSubCdBy(goodsRes){
        var _PCode = $("#mainGdsTypCd").val();//获取主货物大类的value
        if(!_PCode) return;
        $.ajax({
            type: 'post',
            dataType:'json',
            data:{PCode:_PCode},
            /* 获取货品下拉框的数据 */
            url: '<%=path%>/audit/audCreditInfo/getGoodsTypJSON.do',
            success:function(msg){
                if(msg.success == 1){
                    <%--var goodsRes = '${goodsRes}';--%>
                    //主运输货物
                    var goods = $("#goods");
                    if(goods && goods.length && msg.data){
                        $("#goods").empty();
                        $("#goods").append("<option value=''>请选择</option>");
                        var option ="";
                        $.each(msg.data,function(index,obj) {
                            if(goodsRes == obj.key){
                                option = "<option selected='selected'  value='"+obj.key+"'>"+obj.value+"</option>";
                                $("#goods").val(obj.key);
                            }else{
                                option = "<option value='"+obj.key+"'>"+obj.value+"</option>";
                            }
                            $(option).appendTo("#goods");
                            liger.get("goods").setSelect();

                        });
                        $("#goods").add_ligerFormEditor();
                    }
                    SetIframe_height();
                }else{
                    top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
                }
            }
        });
    }

    //第三方资管城配，第三方资管传统转换为传统项目时提示语
    /* function prompt() {
    	$.ligerDialog.confirm("变更项目类型会删除所对应的报价方案和支付表信息，确定要变更吗？", function (flag) {
			if(flag == false) {
				setPrjTypCd();
			}
    	});
    } */

    function changeSelectSun(mark) {
        if (detailFlag == "true") {
            return;
        }
        var bizTypCd = $("#bizTypCd").val();
        /* if(bizTypCd == "5"){
         if($("#prjTypCd").val() != undefined){
         var form = liger.get("prj_bsc_info_form");
         form.setData({
         prjTypCd:"GHKD",
         });
         }
         } */
        /*if (buOrgCd == "00000005" || buOrgCd == "00000013") { if(ProjectConstant.PRJ_TYP_CD_CDDYWYQ == prjTypCdVal){
            if ($("#prjTypCd").val() != undefined) {
                $.ajax({
                    type: 'get',
                    dataType: 'json',
                    url: '<%=path%>/project/prjbscinfo/selectByBizTypTemp.do',
                    data: {
                        bizTypCd: bizTypCd
                    },
                    success: function (data) {
                        liger.get("prjTypCd").clearContent();
                        var newOptions = "";
                        if ($("#bizTypCd").val() != '5') {
                            var newOptions = '<option value="">请选择</option>';
                        }
                        if ($("#bizTypCd").val() != null && $("#bizTypCd").val() != "") {
                            var options = data.selectList;
                            if (options.length > 0) {
                                for (var i = 0; i < options.length; i++) {
                                    newOptions += '<option value="' + options[i].key + '">' + options[i].value + '</option>';
                                }
                            }
                        }
                        $("#prjTypCd").html($(newOptions));
                        liger.get("prjTypCd").setSelect();
                        if (mark == 0) {
                            setPrjTypCd();
                        }
                    },
                    error: function (data) {

                    }
                });
            }
        }*/
        if ($("#bizModCd").val() != undefined) {
            $.ajax({
                type: 'get',
                dataType: 'json',
                url: '<%=path%>/project/prjbscinfo/selectByBizTyp.do',
                data: {
                    bizTypCd: bizTypCd,
                    prjId: prjId
                },
                success: function (data) {
                    liger.get("bizModCd").clearContent();
                    var newOptions = '<option value=" ">请选择</option>';
                    if ($("#bizTypCd").val() != null && $("#bizTypCd").val() != "") {
                        var options = data.brCdSelectList;
                        if (options.length > 0) {
                            for (var i = 0; i < options.length; i++) {
                                newOptions += '<option value="' + options[i].key + '">' + options[i].value + '</option>';
                            }
                        }
                    }
                    $("#bizModCd").html($(newOptions));
                    liger.get("bizModCd").setSelect();
                    if (mark == 0) {
                        setBizModCd();
                    }
                },
                error: function (data) {

                }
            });
            /* var form = liger.get("prj_bsc_info_form");
             form.setData({
             bizModCd:'
            ${bizModCd}',
             }); */
        }
    }

    function setBizModCd() {
        var form = liger.get("prj_bsc_info_form");
        form.setData({
            bizModCd: bizModCd,
        });
    }

    function setPrjTypCd() {
        var form = liger.get("prj_bsc_info_form");
        form.setData({
            prjTypCd: prjTypCd,
        });
    }

    function initOrgTree() {
        var params = {};
        if (detailFlag == "true" || prjId) {
            params.cstMgrOrgCd = $("#cstMgrOrgCd").val();
        }
        searchOrgTree = $("#orgCd").ligerComboBox({
            selectBoxWidth: 240,
            selectBoxHeight: 150,
            //限制只能选叶节点，父节点不能点击
            treeLeafOnly: false,
            valueField: 'orgCd',
            textField: 'orgDispNm',
            showTreePath: true,
            tree: {
                ajaxType: 'get',
                idFieldName: 'orgCd',
                textFieldName: 'orgDispNm',
                checkbox: false,
                parentIcon: "none",
                childIcon: "none",
                needCancel: false
            },
            onSelected: function () {
                if (searchOrgTree.treeManager.getSelected()) {
                    var orgCd = searchOrgTree.treeManager.getSelected().data['orgCd'];
                    if (orgCd) {
                        //设置所属客户经理信息
                        setActManager(orgCd, cstMgrId)
                    }
                }
            }
        });
        $.ajax({
            type: 'get',
            dataType: 'json',
            data: params,
            url: '<%=path%>/project/prjbscinfo/searchOrgTree.do',
            success: function (msg) {
                if (msg.success == 1) {
                    searchOrgTree.treeManager.setData(msg.data);
                    searchOrgTree.clear();
                    searchOrgTree.setValue('${currOrg}');
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });

    }
    var searchPrjIndTree = null;
    //租赁物用途
    function initPrjIndTree() {
        var params = {};
        var prjIndCdObj = $("#prjIndCd");//租赁物用途
        if (prjIndCdObj.length) {
            searchPrjIndTree = $("#prjIndCd").ligerComboBox({
                selectBoxWidth: 240,
                selectBoxHeight: 150,
                //限制只能选叶节点，父节点不能点击
                treeLeafOnly: false,
                valueField: 'key',
                textField: 'value',
                showTreePath: true,
                tree: {
                    ajaxType: 'get',
                    idFieldName: 'key',
                    textFieldName: 'value',
                    checkbox: false,
                    parentIcon: "none",
                    childIcon: "none",
                    needCancel: false,
                    isExpand: false,
                }
            });
            $.ajax({
                type: 'get',
                dataType: 'json',
                data: params,
                url: '<%=path%>/project/prjbscinfo/searchPrjIndTree.do',
                success: function (msg) {
                    if (msg.success == 1) {
                        if (searchPrjIndTree) {
                            searchPrjIndTree.treeManager.setData(msg.data);
                            searchPrjIndTree.clear();
                        }
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });

        }

    }


    //根据所选的组织机构设置客户经理信息
    function setActManager(orgCd, cstMgrId) {
        var params = {};
        params.orgCd = orgCd;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: params,
            url: '<%=path%>/project/prjbscinfo/getCstMgrListByOrgId.do',
            success: function (msg) {
                if (msg.success == 1) {
                    setActManagerSelect(msg.data, cstMgrId);
                }
                /* else{
                 $.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                 } */
            }
        });
    }
    //查找项目信息通过ID
    function setPrjbscInfoData() {
        var params = {};
        params.id = $("#prjId").val();
        $.ajax({
            type: 'get',
            dataType: 'json',
            async: false,
            data: params,
            url: '<%=path%>/project/prjbscinfo/getById.do',
            success: function (msg) {
                if (msg.success == 1) {
                    setPrjBscInfoData(msg.data);
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    }

   //查找项目信息通过ID
    function setPrjbscInfoDataById(prjId) {
        var params = {};
        params.id = prjId;
        $.ajax({
            type: 'get',
            dataType: 'json',
            async: false,
            data: params,
            url: '<%=path%>/project/prjbscinfo/getById.do',
            success: function (msg) {
                if (msg.success == 1) {
                    setPrjBscInfoDataForYQ(msg.data);
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    }

    function setPrjBscInfoData(prjbscInfo) {
    	//alert(prjbscInfo.goodsRes);
        if (prjbscInfo) {
            var form = liger.get("prj_bsc_info_form");
            form.setData({
                //prjNm:prjbscInfo.prjNm,
                cstNm: prjbscInfo.cstNm,
                cstId: prjbscInfo.cstId,
                /* fundRasInsNm:prjbscInfo.fundRasInsNm,
                 fundRasInsId:prjbscInfo.fundRasInsId, */
                orgCd: prjbscInfo.cstMgrOrgCd,
                cstMgrId: prjbscInfo.cstMgrId,
                /* 	dsCd:prjbscInfo.dsCd, */
                prjTypCd: prjbscInfo.prjTypCd,
                bizTypCd: prjbscInfo.bizTypCd,
                agntTypCd: prjbscInfo.agntTypCd,
                isGrpBiz: prjbscInfo.isGrpBiz,
                bizResCd: prjbscInfo.bizResCd,
                investTypCd: prjbscInfo.investTypCd,
                deductWayCd: prjbscInfo.deductWayCd,
                insSol: prjbscInfo.insSol,
                refereeTel: prjbscInfo.refereeTel,
                purpose: prjbscInfo.purpose,
                repayWay: prjbscInfo.repayWay,
                guarMsr: prjbscInfo.guarMsr,
                othLsDesc: prjbscInfo.othLsDesc,
                prjRem: prjbscInfo.prjRem,
                rgnProvCd: prjbscInfo.rgnPrCd,
                rgnCityCd: prjbscInfo.rgnCyCd,
                prjIndCd: prjbscInfo.prjIndCd,
                prjOthIndCd: prjbscInfo.prjOthIndCd,
                cstMgrId: prjbscInfo.cstMgrId,
                cntTypCd: prjbscInfo.cntTypCd,
                /* subBizTypCd:prjbscInfo.subBizTypCd, */
                bizModCd: prjbscInfo.bizModCd,
                buyType: prjbscInfo.buyType,
                prjIndCdZc: prjbscInfo.prjIndCd,
                prjIndCdXny: prjbscInfo.prjIndCd,
                isHaveUpStruct: prjbscInfo.isHaveUpStruct,
                mainGdsTypCd:prjbscInfo.mainGdsTypCd,//回显的货物大类
                calId:prjbscInfo.calId,
                isBigCstWork:prjbscInfo.isBigCstWork,
                bigCstWorkSource:prjbscInfo.bigCstWorkSource,
                isInternalTransfer:prjbscInfo.isInternalTransfer,
                compensatoryType:prjbscInfo.compensatoryType==null?'0':compensatoryType
            });
            $("#calQuatPrpsId").val(prjbscInfo.calId);
            beforeCstId = prjbscInfo.cstId;
            beforePrjTypCd = prjbscInfo.prjTypCd;
            cstMgrId = prjbscInfo.cstMgrId;
            selectOrgCd = prjbscInfo.buOrgCd;
            // --> 设置初始值移到ligerForm之后 ！！！
            $("#orgCd").ligerGetComboBoxManager().updateStyle(); //设置值之后，需要刷新组件，才有变化
            $("#cstNm").html(prjbscInfo.cstNm);
            $("#cstId").val(prjbscInfo.cstId);
            $("#cstMgrOrgCd").val(prjbscInfo.cstMgrOrgCd);
            $("#cstNmDiv").show();

            if (prjbscInfo.isInsBiz == CommonConstant.C_YN_Y) {
                /*if(detailFlag=="true"){

                }else{
                    $("#fundRasInsNmField").append("<a onclick='changeIns()' class='link'>修改</a>");
                }*/
                /*if(ProjectConstant.CODE_BU_ORG_CD_ZK == buOrgCd
                    && (ProjectConstant.PRJ_TYP_CD_CDDYWUL == prjbscInfo.prjTypCd
                        || ProjectConstant.PRJ_TYP_CD_ESCJYD == prjbscInfo.prjTypCd)){
                    $("#fundRasInsNmField").append("<a onclick='changeIns()' class='link'>修改</a>");
                    liger.get("isInsBiz").setEnabled();
                }*/
                $("#fundRasInsNm").html(prjbscInfo.fundRasInsNm);
                fundRasInsNmTextShow = prjbscInfo.fundRasInsNm;
                if (arrFoundCode) {
                    for (var i = 0; i < arrFoundCode.length; i++) {
                        if (arrFoundCode[i].fundRasInsId == prjbscInfo.fundRasInsId) {
                            fundRasInsNmTextShow = arrFoundCode[i].fundRasInsNmShow;
                            break;
                        }
                    }
                }
                $("#fundRasInsNmShow").html(fundRasInsNmTextShow);
                $("#fundRasInsId").val(prjbscInfo.fundRasInsId);
                $("#insCode").val(prjbscInfo.insCode);
                insCodeCheck = prjbscInfo.insCode;
                $("#fundRasInsNmDiv").show();
            }
            //设置省、市
            setRgnProvCdUpdataValue(prjbscInfo.rgnPrCd);
            setRgnCityCdUpdataValue(prjbscInfo.rgnCyCd);
            //setActManager(selectOrgCd,cstMgrId);
            pageInApp.flag = false;
        }
        queryCstCreditiInvest();
        getTripGoodsSubCd();
    }

    function setPrjBscInfoDataForYQ(prjbscInfo) {
        if (prjbscInfo) {
            var form = liger.get("prj_bsc_info_form");
            form.setData({
                cstNm: prjbscInfo.cstNm,
                cstId: prjbscInfo.cstId,
                // orgCd: prjbscInfo.cstMgrOrgCd,
                // cstMgrId: prjbscInfo.cstMgrId,
                // prjTypCd: prjbscInfo.prjTypCd,
                bizTypCd: prjbscInfo.bizTypCd,
                agntTypCd: prjbscInfo.agntTypCd,
                isGrpBiz: prjbscInfo.isGrpBiz,
                bizResCd: prjbscInfo.bizResCd,
                investTypCd: prjbscInfo.investTypCd,
                deductWayCd: prjbscInfo.deductWayCd,
                insSol: prjbscInfo.insSol,
                refereeTel: prjbscInfo.refereeTel,
                purpose: prjbscInfo.purpose,
                repayWay: prjbscInfo.repayWay,
                guarMsr: prjbscInfo.guarMsr,
                othLsDesc: prjbscInfo.othLsDesc,
                prjRem: prjbscInfo.prjRem,
                rgnProvCd: prjbscInfo.rgnPrCd,
                rgnCityCd: prjbscInfo.rgnCyCd,
                prjIndCd: prjbscInfo.prjIndCd,
                prjOthIndCd: prjbscInfo.prjOthIndCd,
                // cstMgrId: prjbscInfo.cstMgrId,
                cntTypCd: prjbscInfo.cntTypCd,
                bizModCd: prjbscInfo.bizModCd,
                buyType: prjbscInfo.buyType,
                prjIndCdZc: prjbscInfo.prjIndCd,
                prjIndCdXny: prjbscInfo.prjIndCd,
                isHaveUpStruct: prjbscInfo.isHaveUpStruct,
                mainGdsTypCd: prjbscInfo.mainGdsTypCd,//回显的货物大类
                calId: prjbscInfo.calId,
                paySchTypCd:prjbscInfo.paySchTypCd,
            });
            /*if (liger.get("prjTypCd")) {
                liger.get("prjTypCd").setDisabled(true);
            }*/
            //自认人不可修改
            /*if (liger.get("cntTypCd") && prjbscInfo.getCstTypCd == 1) {
                liger.get("cntTypCd").setDisabled(true);
            }*/
            getTripGoodsSubCdBy(prjbscInfo.goodsRes);
            initPrjIndTree();
        }
    }
    
    function changeIns(){
        var prjTypCdVal = $("#prjTypCd").val();
        $.ligerDialog.confirm("按此修改项目类型将会：删除现有报价及支付表；删除银行卡信息和资方开户信息；确定修改么？", function (flag) {
            if(flag == false) {
                setPrjTypCd();
            }
            else {
                changePrjTypCd(prjTypCdVal);
            }
        });
    }

    //设置所属客户经理选项
    function setActManagerSelect(data, cstMgrId) {
        liger.get("cstMgrId").setValue("  ");
        $("#cstMgrId").empty();
        liger.get("cstMgrId").clear();
        if (data) {
            var html = "";
            for (var i = 0; i < data.length; i++) {
                if (cstMgrId == data[i].id) {
                    html += "<option value='" + data[i].id + "'  cstMgrOrgCd='" + data[i].orgCd + "' cstMgrNm='" + data[i].refRlNm + "'  selected='selected'>" + data[i].refRlNm + data[i].usrNm + "</option>";
                } else {
                    html += "<option value='" + data[i].id + "'  cstMgrOrgCd='" + data[i].orgCd + "' cstMgrNm='" + data[i].refRlNm + "'>" + data[i].refRlNm + data[i].usrNm + "</option>";
                }
            }
            $(html).appendTo('#cstMgrId');
            liger.get("cstMgrId").setSelect();
        }
    }
    //判断是否厂商业务
    function isShowTips() {
        var isSplMfr = $("#isSplMfr").val();
        if (isSplMfr === "0") {
            $("#isSplMfrShowDiv").hide();
        } else if (isSplMfr === "1") {
            $("#isSplMfrShowDiv").show();
        }
    }
    //初始化Tab
    function initTab() {
        if (showTabs != "" && showTabs != null) {
            var tabs = showTabs.split(",");
            $("#" + localTabs[0] + "Id").attr("lselected", false);
            $("#" + tabs[0] + "Id").attr("lselected", true);
        }
        pageInTab = $("#pageInTab").ligerTab({
            height: 'auto',
            contextmenu: false,
            minIframeHeight: GET_minIframeHeight(),
            onBeforeSelectTabItem: function (tabid) {
                if (tabid != "tabA" && tabid != "tabH") {
                    if (pageInApp.flag) {
                        top.$.ligerDialog.SQalert({content: LogUtils.LOG_PRJ__PRD_SELECT_BEFORE, SQ_type: "warning"});
                        return false;
                    }
                    if(tabid == "tabN"){
                    	if (prjId == null || prjId == '') {
                            top.$.ligerDialog.SQalert({
                                content: "请先维护项目产品信息",
                                SQ_type: "warning"
                            });
                            return false; //验证不通过，不执行以下代码
                        }
                    	checkPrject(prjId);
                    	if(rtnMsg != "1"){
                   		 top.$.ligerDialog.SQalert({
                                content: rtnMsg,
                                SQ_type: "warning"
                            });
                            return false; //验证不通过，不执行以下代码
                   		}
                    }
                    if(detailFlag != "true"){
                        if(tabid != "tabP"  && !(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD)){//验证路由信息
                            checkRoute(0);
                            if(routeMsg != "1"){
                                top.$.ligerDialog.SQalert({
                                    content: routeMsg,
                                    SQ_type: "warning"
                                });
                                return false; //验证不通过，不执行以下代码
                            }
                        }
                        if(tabid == "tabP" && (prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD) && !firstCheck){//验证路由信息
                            checkRoute(2);
                            if(routeMsg != "1"){
                                top.$.ligerDialog.SQalert({
                                    content: routeMsg,
                                    SQ_type: "warning"
                                });
                                return false; //验证不通过，不执行以下代码
                            }
                        }
                        if(tabid == "tabE"){//验证是否有未补充完整的设备信息
                            checkRoute(1);
                            if(routeMsg != "1"){
                                top.$.ligerDialog.SQalert({
                                    content: routeMsg,
                                    SQ_type: "warning"
                                });
                                return false; //验证不通过，不执行以下代码
                            }
                        }
                    }
                }
            },
            onAfterSelectTabItem: function (tabid) {
                //   if (loadedTabs.indexOf(tabid)<0) {
                if (tabid != "tabA" && tabid != "tabH") {
                    if (prjId == null || prjId == '') {
                        prjId = $("#prjId").val();
                        if (prjId == null || prjId == '') {
                            top.$.ligerDialog.SQalert({
                                content: LogUtils.LOG_PRJ__PRD_SELECT_BEFORE,
                                SQ_type: "warning"
                            });
                            return false; //验证不通过，不执行以下代码
                        }
                    }
                    
	                if(tabid == "tabN"){
                    	checkPrject(prjId);
                    	if(rtnMsg != "1"){
                   		 top.$.ligerDialog.SQalert({
                                content: rtnMsg,
                                SQ_type: "warning"
                            });
                            return false; //验证不通过，不执行以下代码
                   		}
                    }
                    if(detailFlag != "true" && !(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD)){
                        if(tabid != "tabP"){//验证路由信息
                            checkRoute(0);
                            if(routeMsg != "1"){
                                top.$.ligerDialog.SQalert({
                                    content: routeMsg,
                                    SQ_type: "warning"
                                });
                                return false; //验证不通过，不执行以下代码
                            }
                        }
                        if(tabid == "tabE"){//验证是否有未补充完整的设备信息
                            checkRoute(1);
                            if(routeMsg != "1"){
                                top.$.ligerDialog.SQalert({
                                    content: routeMsg,
                                    SQ_type: "warning"
                                });
                                return false; //验证不通过，不执行以下代码
                            }
                        }
                    }
                }
                loadedTabs.push(tabid);
                var url = "<%=path%>/project/prjbscinfo/toProjectSurveyPhotosList.do?prjId=" + prjId + "&&detailFlag=" + detailFlag;
                var pInstId = $("#pInstId").val();
                var preTaskIds = $("#preTaskIds").val();
                var flowParms = "&&pInstId=" + pInstId + "&&preTaskIds=" + preTaskIds;
                var prjId = $("#prjId").val();
                if(StringUtils.isEmpty(detailFlag)){
                    detailFlag = false;
                }
                switch (tabid) {
                    case "tabA":
                        //window.location.reload();
                        break;
                    case "tabP":
                        if(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD){
                            pageInTab.setTabItemSrc(tabid, "<%=path%>/insroute/insRouteBscInfo/toMainPageEsc.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        }else{
                            pageInTab.setTabItemSrc(tabid, "<%=path%>/insroute/insRouteBscInfo/toMainPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        }
                        break;
                    case "tabB":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjPrdListPage.do?id=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        break;
                    case "tabC":
                        if (detailFlag == "true" || flowCheckStsCd == "2") {
                            pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjDetailInvestRptPage.do?prjId=" + prjId + "&&detailFlag=" + true + "&&cstRlCd=" + ProjectConstant.CST_RL_CST);
                        } else {
                            pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjInvestAddPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&&cstRlCd=" + ProjectConstant.CST_RL_CST + flowParms);
                        }
                        $("#tabCId").attr("prjId", prjId);
                        $("#tabCId").attr("detailFlag", detailFlag);
                        $("#tabCId").attr("cstRlCd", ProjectConstant.CST_RL_CST);
                        break;
                    //  case "tabD":
                    // pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjcstbscInfo/toListPage.do?prjId="+prjId+"&&detailFlag="+detailFlag+"&&cstRlCd="+ProjectConstant.CST_RL_URGENT);
                    //   $("#tabDId").attr("prjId",prjId);
                    //  $("#tabDId").attr("detailFlag",detailFlag);
                    //  $("#tabDId").attr("cstRlCd",ProjectConstant.CST_RL_SPONSOR);
                    // break;
                    case "tabE":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjquatprps/toListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&&isFlow=" + isFlow + flowParms);
                        break;
                    case "tabF":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprddtl/toListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        break;
                    case "tabG":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprddtl/toPrjPrdDtlListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        break;
                    case "tabK":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjFileInfo/toFileInfoListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        break;
                    case "tabL":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/cont/toListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                        break;
                    case "tabM":
                    	pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjBscInfoInsDistribute/toPrjBscInsEditPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&fromCAFlag=" + fromCAFlag + "&fromCMFlag=" + fromCMFlag);
                    	break;
                    case "tabN":
                    	pageInTab.setTabItemSrc(tabid, "<%=path%>/inscare/insapplication/toInsuranceTabPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag );
                    	break;
                    case "tabO":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjBscInfoInsDistribute/toInsReviewTabPage.do?prjId=" + prjId);
                        break;
                    case "tabQ":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjquatprps/toPrjPlcyIndex.do?prjId=" + prjId + "&&isLimitAddFlow=false");
                        break;
                    case "tabR":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjRskAudWarnRec/toPrjRskAudWarnRecTabPage.do?optTyp=1&prjId=" + prjId);
                        break;
                    case "tabH":
                        if (flowCheckStsCd == "2") {
                            pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjPreAudInfo/toAddPreAudTabPage.do?prjId=" + prjId + "&&detailFlag=" + true);
                        } else {
                            pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjPreAudInfo/toAddPreAudTabPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag);
                        }
                        break;
                }
                //     };
                SetIframe_height();
            }
        });
        pageInTab.setTabButton(); //设置左右两侧箭头

        function checkRoute(flag){
            prjId = $("#prjId").val();
            $.ajax({
                type: 'post',
                dataType: 'json',
                async: false,
                data: {prjId:prjId,flag:flag},
                url: "<%=path%>/insroute/insRouteBscInfo/checkRoute.do",
                success: function (msg) {
                    if (msg.success == 0) {
                        routeMsg = msg.info;
                        return false;
                    }else{
                        routeMsg = "1";
                        return true;
                    }
                }
            });
        }

        if (showTabs != "" && showTabs != null) {
            var tabs = showTabs.split(",");
            tabid = tabs[0];
            switch (tabid) {
                case "tabA":
                    //window.location.reload();
                    break;
                case "tabP":
                    if(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD){
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/insroute/insRouteBscInfo/toMainPageEsc.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                    }else{
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/insroute/insRouteBscInfo/toMainPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + flowParms);
                    }
                    break;
                case "tabB":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjPrdListPage.do?id=" + prjId + "&&detailFlag=" + detailFlag);
                    break;
                    if (detailFlag == "true") {
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjDetailInvestRptPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&&cstRlCd=" + ProjectConstant.CST_RL_CST);
                    } else {
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjInvestAddPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&&cstRlCd=" + ProjectConstant.CST_RL_CST);
                    }
                    $("#tabCId").attr("prjId", prjId);
                    $("#tabCId").attr("detailFlag", detailFlag);
                    $("#tabCId").attr("cstRlCd", ProjectConstant.CST_RL_CST);
                    break;
                //  case "tabD":
                // pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjcstbscInfo/toListPage.do?prjId="+prjId+"&&detailFlag="+detailFlag+"&&cstRlCd="+ProjectConstant.CST_RL_URGENT);
                //   $("#tabDId").attr("prjId",prjId);
                //  $("#tabDId").attr("detailFlag",detailFlag);
                //  $("#tabDId").attr("cstRlCd",ProjectConstant.CST_RL_SPONSOR);
                // break;
                case "tabE":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjquatprps/toListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag);
                    break;
                case "tabF":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprddtl/toListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag);
                    break;
                case "tabG":
                    if (ywParam == "1") {
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprddtl/toPrjPrdDtlListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&&ywParam=" + ywParam + "&&buOrgCd=" + buOrgCd);
                    } else {
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprddtl/toPrjPrdDtlListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag);
                    }
                    break;
                case "tabK":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjFileInfo/toFileInfoListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag);
                    break;
                case "tabL":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/cont/toListPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag);
                    break;
                case "tabM":
                	pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjBscInfoInsDistribute/toPrjBscInsEditPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag + "&fromCAFlag=" + fromCAFlag + "&fromCMFlag=" + fromCMFlag);
                	break;
                case "tabN":
                	pageInTab.setTabItemSrc(tabid, "<%=path%>/inscare/insapplication/toInsuranceTabPage.do?prjId=" + prjId + "&&detailFlag=" + detailFlag );
                	break;
                case "tabO":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjBscInfoInsDistribute/toInsReviewTabPage.do?prjId=" + prjId);
                    break;
                case "tabQ":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjquatprps/toPrjPlcyIndex.do?prjId=" + prjId + "&&isLimitAddFlow=false");
                    break;
                case "tabR":
                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjRskAudWarnRec/toPrjRskAudWarnRecTabPage.do?optTyp=1&prjId=" + prjId);
                    break;
            }
        }
        //pageInTab.removeTabItem("tabL");
        var isA = true;
        if (showTabs != "" && showTabs != null) {
            var tabs = showTabs.split(",");
            for (var i = 0; i < localTabs.length; i++) {
                for (var j = 0; j < tabs.length; j++) {
                    if (localTabs[i] == tabs[j]) {
                        if (tabs[j] == "tabA") {
                            isA = false;
                        }
                        break;
                    } else if (j == tabs.length - 1) {
                        pageInTab.removeTabItem(localTabs[i]);
                    }
                }
            }
        }
        if(${sysInsTabCfgVO == null || sysInsTabCfgVO.isVisible == 0}) {
            pageInTab.removeTabItem("tabM");
        }

        if(CommonConstant.C_YN_Y != routeCheck){
            pageInTab.removeTabItem("tabP");
        }

        $.extend(true, pageInApp, {
            pageInTab: pageInTab
        });
        if (showTabs == "" || showTabs == null || isA == false) {
            initData();
        } else {
            pageInApp.flag = false;
        }
    };

    function savePrjBscInfo() {
        var savePrjTypCd = $("#prjTypCd").val();
        console.log("保存项目,项目类型savePrjTypCd: " + savePrjTypCd);
        var preStrCheckFlag = "0";//预筛选强校验标志,0-否 1-是
        var onCancel = function (item, Dialog) {
            Dialog.hide();
        };
        var onConfirmBtn = function (item, Dialog) {
            Dialog.hide();
            savePrjBscInfofinal();
        };
        var preRouteId = $("#preRouteId").val();//预筛选记录Id
        var preResId = $("#preResId").val();//预筛选结果Id

        //是否进行预筛选强校验
        if(prjTypCdAllowedMapJSON != null){
            for(var i=0;i<prjTypCdAllowedMapJSON.length;i++){
                if (prjTypCdAllowedMapJSON[i].prjTypCd == savePrjTypCd) {
                    preStrCheckFlag = prjTypCdAllowedMapJSON[i].preStrCheckFlag;
                }
            }
        }
        console.log("保存项目,prjTypCdAllowedMapJSON:" + prjTypCdAllowedMapJSON +";预筛选强校验preStrCheckFlag: " + preStrCheckFlag);

        if(preStrCheckFlag == "1"){
            if(prjTypCdAllowedList != ""){
                if(prjTypCdAllowedList.indexOf(savePrjTypCd) != -1){
                    <%--
                        项目类型为车抵贷业务线下,二手车交易贷,内转交易贷需进行预筛选校验
                        1.判断项目状态为“预审审核通过”或者“驳回呈报人”,执行下一步,反之则返回
                        2.当前项目类型对应的预筛选为必填,执行下一步,反之则返回
                        3.断项目信息中预筛选记录是否为空
                            是：提示“请先进行预筛选并在此选择预筛选结果”，项目信息不保存
                            不是：项目信息保存
                        4.判断当前项目对应的筛选记录下是否存在筛选结果无对应的项目信息或项目信息为待提交/预审核中/预审核通过/驳回呈报人
                     --%>
                    console.log("项目状态: " + audStsCd + ", 预筛选强校验标志: " + preStrCheckFlag + ", 呈报人节点标志: " + fromCMFlag);
                    if(savePrjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || savePrjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD
                        || savePrjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD){
                        if(audStsCd == FlowConstant.FLOW_CHECK_STATE_PRE_PASS || audStsCd == FlowConstant.FLOW_CHECK_STATE_RETURN_BACK){
                            if(preRouteId == "" || preResId == ""){
                                top.$.ligerDialog.SQalert({content: "请先进行预筛选并在此选择预筛选结果！", SQ_type: "error"});
                                return false;
                            }
                            checkOtherPreResStatus(preRouteId,preResId);
                        }
                    }else{
                        if(preRouteId == "" || preResId == ""){
                            top.$.ligerDialog.SQalert({content: "预筛选机构不能为空，请选择！", SQ_type: "error"});
                            return false;
                        }
                    }
                }
            }
        }

        var insCodeFinal = $("#insCode").val();
        var prjId = $("#prjId").val();
        if(prjId != null && (insCodeFinal != insCodeCheck)){
            $.ligerDialog.SQopen({
                width: 450,
                title : '友情提示',
                target : $('#confirm_form'),
                buttons: [
                    {
                        text: "确认", onclick: onConfirmBtn, type: 'ok', cls: 'l-dialog-btn-ok'
                    },{
                        text: "取消", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
                    }
                ]
            });
        }else{
            savePrjBscInfofinal();
        }
    }

    //保存项目基础信息
    function savePrjBscInfofinal() {
        if(isMateRskLvlCdIsC === "1"){
            top.$.ligerDialog.SQalert({content: "查询当前承租人名下有配偶信息准入且征信级别为C级，不可立项，请联系事业部风险总监批示！", SQ_type: "warning"});
            return false;
        }
        var ligerForm = liger.get("prj_bsc_info_form");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var data = ligerForm.getData();
        var prjTypCd = $("#prjTypCd").val();
        var cstTypCd = $("#cstTypCd").val();
        var cntTypCd = $("#cntTypCd").val();
        //二手车 校验合同签署方式与客户类型是否匹配
        if(buOrgCd === ProjectConstant.CODE_BU_ORG_CD_ZK && (prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD)){
            if(cstTypCd == "1" && cntTypCd == "2"){
                top.$.ligerDialog.SQalert({content: "二手车业务客户类型为自然人时合同签署方式请选择电子", SQ_type: "warning"});
                return false;
            }
            if(cstTypCd == "2" && cntTypCd == "1"){
                top.$.ligerDialog.SQalert({content: "二手车业务客户类型为法人时合同签署方式请选择纸质", SQ_type: "warning"});
                return false;
            }
        }
        var isSplMfr = $("#isSplMfr").val();
        var isBigCstWork = $("#isBigCstWork").val();
        var bigCstWorkSource = $("#bigCstWorkSource").val();
        if(isBigCstWork == "1" && StringUtils.isEmpty(bigCstWorkSource)){
            top.$.ligerDialog.SQalert({content: "大客户业务来源不能为空", SQ_type: "warning"});
            return false;
        }
        if((buOrgCd === ProjectConstant.CODE_BU_ORG_CD_ZK && !isSplMfr && (prjTypCd==="CPYW" || prjTypCd==="CTYW"||prjTypCd == "DSFZGCP"||prjTypCd == "DSFZGCT"))
            || (buOrgCd == ProjectConstant.CODE_BU_ORG_CD_XNY && !isSplMfr && prjTypCd == ProjectConstant.CODE_PRJ_TYP_CD_CPYW)){
            top.$.ligerDialog.SQalert({content: "请选择是否厂商业务！", SQ_type: "warning"});
            return false;
        }
        if (isSplMfr === "1") {
            if(!$("#rgnProvCd").val()){
                top.$.ligerDialog.SQalert({content: "厂商业务 区域-省不能为空！", SQ_type: "error"});
                return false;
            }
            if(!$("#rgnCityCd").val()){
                top.$.ligerDialog.SQalert({content: "厂商业务 区域-市不能为空！", SQ_type: "error"});
                return false;
            }
        }

        if($("#prjId").val()=="" && prjTypCd==="CDDYW"){
            top.$.ligerDialog.SQalert({content: "不支持创建车抵贷项目！", SQ_type: "error"});
            return false;
        }
        if (!prjTypCd && buOrgCd == "00000013") {
            top.$.ligerDialog.SQalert({content: "请选择项目类型！", SQ_type: "error"});
            return false;
        }
        if(!$("#cstId").val()){
            top.$.ligerDialog.SQalert({content: "请选择客户信息！", SQ_type: "error"});
            return false;
        }
        if ($("#prjTypCd").val() == "DSFZGCP" || $("#prjTypCd").val() == "DSFZGCT") {
            if ($("#fundRasInsId").val() == "") {
                top.$.ligerDialog.SQalert({content: "组织机构不能为空！", SQ_type: "error"});
                return false;
            }
            if ($("#insCode").val()==="czbank"){
                if($("#cstTypCd").val() == ProjectConstant.CST_TYP_CD_LP){
                    top.$.ligerDialog.SQalert({content: "暂不支持法人客户！", SQ_type: "error"});
                    return false;
                }
                // if(!$("#certValidSDt").val()||!$("#certValidEDt").val()){
                //     top.$.ligerDialog.SQalert({content: "请先维护客户证件的有效起止日期！", SQ_type: "error", SQ_showButtons:true});
                //     return false;
                // }
                if(!$("#bkNo").val()){
                    top.$.ligerDialog.SQalert({content: "开户银行不能为空！", SQ_type: "error"});
                    return false;
                }
                if(!$("#accNo").val()){
                    top.$.ligerDialog.SQalert({content: "银行账号不能为空！", SQ_type: "error"});
                    return false;
                }
                if(!$("#mp").val()){
                    top.$.ligerDialog.SQalert({content: "预留手机号不能为空！", SQ_type: "error"});
                    return false;
                }
                data["bkNo"] = liger.get("bkNo").selectedValue;
                data["bkNm"] = liger.get("bkNo").selectedText;
                data["accNo"] =  $("#accNo").val();
                data["mp"] = $("#mp").val();
                data["certNo"] = $("#certNo").val();
                data["certTypCd"] = $("#certTypCd").val();
            }

            if ($("#insCode").val()==="alipay"){
            	//网商
            	if(!$("#wsAccNo").val()){
                    top.$.ligerDialog.SQalert({content: "支付宝账号不能为空！", SQ_type: "error"});
                    return false;
                }
            	  data["accNo"] =  $("#wsAccNo").val();
            }
            if ($("#insCode").val()==="spdbank"){
            	//浦发
            	if(!$("#rgnProvCd").val()){
                    top.$.ligerDialog.SQalert({content: "区域-省不能为空！", SQ_type: "error"});
                    return false;
                }
            	if(!$("#rgnCityCd").val()){
                    top.$.ligerDialog.SQalert({content: "区域-市不能为空！", SQ_type: "error"});
                    return false;
                }
            }
            if ($("#insCode").val()==="zbbank"){
            	//浦发
            	if(!$("#rgnProvCd").val()){
                    top.$.ligerDialog.SQalert({content: "区域-省不能为空！", SQ_type: "error"});
                    return false;
                }
            	if(!$("#rgnCityCd").val()){
                    top.$.ligerDialog.SQalert({content: "区域-市不能为空！", SQ_type: "error"});
                    return false;
                }
        	}
        }
        if (!isChkFlag && isChkFlag == 0 && buOrgCd == "00000001" && insCode && insCode == ProjectConstant.PRJ_INS_CODE_ICBC) {
            top.$.ligerDialog.SQalert({content: "请查询配偶的征信信息！", SQ_type: "error"});
            return false;
        }
        /* 	var flag =  checkPrjNm();
         if(flag){
         return false; //验证不通过，不执行以下代码
         } */
        /*      	if(!getRgnProvCd()){
         top.$.ligerDialog.SQalert({content: "请选择所在省信息！",SQ_type: "warning"});
         return false;
         }
         if(!getRgnCityCd()){
         top.$.ligerDialog.SQalert({content: "请选择所在市信息！",SQ_type: "warning"});
         return false;
         } */
        //	var prjNm = $("#prjNm").val();
        var prjId = $("#prjId").val();
        //	  if(prjId){

        var selectedOptions = liger.get("cstMgrId").element.selectedOptions;
        var cstMgrOrgCd = $(selectedOptions).attr('cstMgrOrgCd');
        // var cstMgrNm =  $(selectedOptions).attr('cstMgrNm');
        var cstMgrNm = liger.get("cstMgrId").select.find('[selected="selected"]').attr('cstmgrnm');
        var cstMgrId = $("#cstMgrId").val();
        var orgCd = searchOrgTree.treeManager.getSelected().data['orgCd'];
        var isSuppSplMfr = $("#isSuppSplMfr").val();
        var  calId = $("#calQuatPrpsId").val();
        /*if(isSuppSplMfr&&isSuppSplMfr=="0"){
            calId = "";
        }*/
        var isSplMfrCheck = $("#isSplMfr").val();
        if(CommonConstant.C_YN_Y == isSplMfrCheck && StringUtils.isEmpty(calId)){
            if(buOrgCd != ProjectConstant.CODE_BU_ORG_CD_XNY || prjTypCd != ProjectConstant.PRJ_TYP_CD_CPYW){
                top.$.ligerDialog.SQalert({content: "厂商业务，请选择厂商报价器", SQ_type: "error"});
                return false;
            }
        }
        if (prjTypCd == "LCV" && "0" == $("#isGrpBiz").val()) {
            top.$.ligerDialog.SQalert({content: "目前不支持散单", SQ_type: "error"});
            return false;
        }
        if (prjTypCd == "LCV" && "0" != $("#isGrpBiz").val() && "2" != $("#cntTypCd").val()) {
            top.$.ligerDialog.SQalert({content: "轻卡团单业务合同签署方式请选择纸质", SQ_type: "error"});
            return false;
        }
        // 疫情项目
        if(ProjectConstant.PRJ_TYP_CD_CDDYWYQ == prjTypCd){
            if(ProjectConstant.CODE_BU_ORG_CD_XNY == buOrgCd){
                top.$.ligerDialog.SQalert({content: "新能源事业部不可以选择车抵贷YQ项目", SQ_type: "error"});
                return false;
            }
            gridYq = liger.get("ligergrid_prjYq");
            var selectedRows = gridYq.getSelectedRows();
            var paySchYQList =  new Array() ;

            if (selectedRows.length == 0) {
                top.$.ligerDialog.SQalert({content: "车抵贷YQ项目请选择支付表", SQ_type: "error"});
                return false;
            }
            if (selectedRows.length > 0) {
                var prjId ;
                for(var i=0;i< selectedRows.length;i++){
                    var paySchYQ = {};
                    if(i == 0){
                        prjId = selectedRows[i].prjId;
                    }
                    var paySchId =  selectedRows[i].paySchId;
                    var paySchNo =  selectedRows[i].paySchNo;
                    var paySchPd =  selectedRows[i].paySchPd;
                    var yPrjId =  selectedRows[i].prjId;
                    var prjPrdId =  selectedRows[i].prjPrdId;
                    var prjInsTypCd =  selectedRows[i].prjInsTypCd;
                    if(prjId != selectedRows[i].prjId){
                        top.$.ligerDialog.SQalert({content: "车抵贷YQ项目必须选择同一个项目的支付表", SQ_type: "error"});
                        return false;
                    }
                    paySchYQ["paySchNo"] = paySchNo;
                    paySchYQ["paySchId"] = paySchId;
                    paySchYQ["prjId"] = prjId;
                    paySchYQ["paySchPd"] = paySchPd;
                    paySchYQ["yPrjId"] = yPrjId;
                    paySchYQ["prjPrdId"] = prjPrdId;
                    paySchYQ["prjInsTypCd"] = prjInsTypCd;
                    paySchYQList[i] = paySchYQ;
                }

            }
            data["checkPaySchYQList"] = JSON.stringify(paySchYQList);
        }

        data["cstMgrOrgCd"] = orgCd;
        data["cstMgrNm"] = cstMgrNm;
        data["rgnPrCd"] = getRgnProvCd();
        data["rgnCyCd"] = getRgnCityCd();
        data["orgCd"] = orgCd;
        data["isFlow"] = isFlow;
        data["cstId"] = $("#cstId").val();
        data["calId"] = calId;
        data["cstNm"] = $("#cstNm").text();
        data["cstTypCd"] = $("#cstTypCd").val();
        data["fundRasInsId"] = $("#fundRasInsId").val();
        data["fundRasInsNm"] = $("#fundRasInsNm").text();
        data["insCode"] = $("#insCode").val();
        data["pledge"] = $("#pledge").val();//是否需要抵押
        data["mainGdsTypCd"] = $("#mainGdsTypCd").val();//主货物大类
        data["compensatoryType"] = $("#compensatoryType").val();//代偿担保业务类型
        data["goods"] = $("#goods").val();//主运输货物
        data["isSplMfr"] = $("#isSplMfr").val();

        data["isInsBiz"] = $("#isInsBiz").val();
        data["homeVisit"] = $("#homeVisit").val();

        data["preRouteId"] = $("#preRouteId").val();//预筛选记录Id
        data["preResIdOld"] = preResIdOld;//之前预筛选结果Id
        data["preResId"] = $("#preResId").val();//预筛选结果Id

        //机构ID,机构名称,机构编码为null时,直接设置为空
        if (data["fundRasInsId"] == "null") {
            data["fundRasInsId"] = ' ';
        }
        if (data["fundRasInsNm"] == "null") {
            data["fundRasInsNm"] = ' ';
        }
        if (data["insCode"] == "null") {
            data["insCode"] = ' ';
        }

        var prjIndCdObj = $("#prjIndCd");//租赁物用途(重卡)
        var prjIndCdZcObj = $("#prjIndCdZc");//租赁物用途(专车)
        var prjIndCdXnyObj = $("#prjIndCdXny");//租赁物用途(新能源汽车)
        if (prjIndCdObj.length) {
            var prjIndCd = searchPrjIndTree.treeManager.getSelected().data['key'];
            data["prjIndCd"] = prjIndCd;
        }
        if (prjIndCdZcObj.length) {
            data["prjIndCd"] = $("#prjIndCdZc").val();
        }
        if (prjIndCdXnyObj.length) {
            data["prjIndCd"] = $("#prjIndCdXny").val();
        }
        if(prjTypCd == "ESCJYD"){
            if (StringUtils.isEmpty($("#isInternalTransfer").val()) || $("#isInternalTransfer").val() === undefined){
                top.$.ligerDialog.SQalert({content: "请选择是否内部转让", SQ_type: "error"});
                return false;
            }else{
                data["isInternalTransfer"] = $("#isInternalTransfer").val();
            }
        }
        var url = '<%=path%>/project/prjbscinfo/add.do';
        var prjId = $("#prjId").val();
        data["prjId"] = prjId;
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: url,
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    if (prjId && msg.data.isHaveQuat == 1) {
                        UIUtils.alertSuccessHold1("修改成功！修改项目类型会影响方案信息，请核查！");
                    } else {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    }
                    $("#prjId").val(msg.data.id);
                    var prjTypCd = $("#prjTypCd").val();
                    /*if(prjTypCd.)*/
                    insCodeCheck = $("#insCode").val();
                    pageInApp.flag = false;
                    if(CommonConstant.C_YN_Y == msg.data.routeCheck){
                        if(!(pageInTab.isTabItemExist("tabP"))){
                            firstCheck = true;
                            var pInstId = $("#pInstId").val();
                            var preTaskIds = $("#preTaskIds").val();
                            var flowParms = "&&pInstId=" + pInstId + "&&preTaskIds=" + preTaskIds;
                            var insUrl = "<%=path%>/insroute/insRouteBscInfo/toMainPage.do?prjId=" + msg.data.id + "&&detailFlag=" + detailFlag + flowParms;
                            if(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD){
                                insUrl = "<%=path%>/insroute/insRouteBscInfo/toMainPageEsc.do?prjId=" + msg.data.id + "&&detailFlag=" + detailFlag + flowParms;
                            }
                            pageInTab.addTabItem({
                                text: "资管路由筛选",
                                tabid: 'tabP',
                                showClose: false,
                                callback: function(){
                                    $('.pageInTab .l-tab-links ul').css("left","0px");
                                },
                                url: insUrl,
                            });
                        }
                    }else{
                        pageInTab.removeTabItem("tabP");
                    }
                    firstCheck = false;
                    if (prjTypCd=='CDDYWUL' || prjTypCd=='OWNJYD' || prjTypCd=='ESCJYD'){
                        var _url = "<%=path%>/project/prjPreAudInfo/toAddPreAudTabPage.do?prjId=" + msg.data.id + "&&detailFlag=" + false;
                        if(!(pageInTab.isTabItemExist("tabH"))){
                            pageInTab.addTabItem({
                                text: "预审信息",
                                tabid: 'tabH',
                                showClose: false,
                                url: _url,
                            });
                        }
                    } else {
                        if(pageInTab.isTabItemExist("tabH")){
                            pageInTab.removeTabItem("tabH");
                        }
                    }
                } else if (msg.success == 10000) {
                    UIUtils.alertSuccessHold1(msg.info);
                } else {
                    UIUtils.alertErrorHold1(msg.info);
                    //top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }

                if(!msg.data.sysInsTabCfgVO || msg.data.sysInsTabCfgVO.isVisible == 0) {
                	pageInTab.removeTabItem("tabM");
                } else if (flowCheckStsCd == "1" && (prjTypCd == "CDDYWUL" || prjTypCd == "ESCJYD" || prjTypCd == "OWNJYD")) {
                    pageInTab.removeTabItem("tabM");
                } else {
                	if(pageInTab.isTabItemExist("tabM")) {
                    	pageInTab.setTabItemTitle('tabM', msg.data.sysInsTabCfgVO.title);
                	}
                	else {
                		pageInTab.addTabItem({
                    		text: msg.data.sysInsTabCfgVO.title,
                    		tabid: 'tabM',
                    		showClose: false,
                    		url: '<%=path%>/project/prjBscInfoInsDistribute/toPrjBscInsEditPage.do?prjId='+msg.data.id + "&fromCAFlag=" + fromCAFlag + "&fromCMFlag=" + fromCMFlag,
                    	});
                	}
                }
                $('.l-tab-links ul').css("left","0px");
            }
        });

        <%-- 	  }else{
              var url = '<%=path%>/project/prjbscinfo/checkPrjNm.do';
           var params = {};
                 params.prjNm = prjNm;//项目名称
               $.ajax({
                   type: 'post',
                   dataType:'json',
                   data:params,
                   url: url,
                   success:function(msg){
                        if(msg.success == 1){
                            top.$.ligerDialog.SQalert({content: "该项目已经存在！",SQ_type: "error"});
                            return false;
                        }else{
                             var data = ligerForm.getData();
                               var selectedOptions=liger.get("cstMgrId").element.selectedOptions;
                               var cstMgrOrgCd =  $(selectedOptions).attr('cstMgrOrgCd');
                               var cstMgrNm =  $(selectedOptions).attr('cstMgrNm');
                               var cstMgrId = $("#cstMgrId").val();
                               var orgCd = searchOrgTree.treeManager.getSelected().data['orgCd'];
                               data["cstMgrOrgCd"] =orgCd;
                               data["cstMgrNm"] =cstMgrNm;
                               data["rgnPrCd"] =getRgnProvCd();
                               data["rgnCyCd"] =getRgnCityCd();
                               data["orgCd"] =orgCd;
                               data["cstId"] =$("#cstId").val();
                               data["cstNm"] =$("#cstNm").text();
                               var prjIndCdObj =$("#prjIndCd");//租赁物用途
                               if(prjIndCdObj.length){
                               var prjIndCd = searchPrjIndTree.treeManager.getSelected().data['key'];
                               data["prjIndCd"] =prjIndCd;
                               }
                               var url = '<%=path%>/project/prjbscinfo/add.do';
                               var prjId = $("#prjId").val();
                               data["prjId"]= prjId;
                               var wait_dialog;
                               $.ajax({
                                   type: 'post',
                                   dataType:'json',
                                   data:data,
                                   url: url,
                                   beforeSend: function(){
                                         wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
                                    },
                                   success:function(msg){
                                                wait_dialog.close();
                                        if(msg.success == 1){
                                                top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
                                            /*   var TAB=top.mainApp.parentTab;
                                                   var currentTabid=TAB.getSelectedTabItemID();
                                                   var currFrameElement=top.$("#"+currentTabid).get(0);
                                                    var callback=currFrameElement.W2W.callback;
                                                           callback();
                                                       top.tab.removeTabItem(currentTabid);  */
                                                      $("#prjId").val(msg.data);
                                                      pageInApp.flag=false;
                                        }else{
                                            top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                                        }
                                   }
                               });
                        }
                   }
               });

              } --%>
    }
    //取消
    function cancelBtn() {
        var TAB = top.mainApp.parentTab;
        var currentTabid = TAB.getSelectedTabItemID();
        top.tab.removeTabItem(currentTabid);
    }

    //选择机构页面(预筛选)
    function chooseMecPage(){
        //获取客户ID
        if(!$("#cstId").val()){
           top.$.ligerDialog.SQalert({content: "请选择客户信息！", SQ_type: "error"});
           return;
        }
        //获取项目类型
        if(!$("#prjTypCd").val()){
           top.$.ligerDialog.SQalert({content: "请选择项目类型！", SQ_type: "error"});
           return;
        }
        $.ligerDialog.open({
            title: '选择机构(预筛选)',
            height: 500,
            width: 850,
            url: '<%=path%>/project/prjbscinfo/toChooseMecPage.do?cstId=' + $("#cstId").val() + '&&prjTypCd=' + $("#prjTypCd").val()
         });
    }

    //选择客户页面
    function chooseCstPage() {
        //if(prjTypCdAllowedList != ""){
            //选择客户按钮触发后，清空预筛选信息(联动效果留待下个迭代版本)
            //$("#fundRasInsNm").html("");
            //$("#preRouteId").val("");
            //$("#preResId").val("");
        //}
        var cstRlFlag = ProjectConstant.CST_RL_CST;//客户
        var addPrjPage = "1";
        $.ligerDialog.open({
            title: '选择客户',
            height: 500,
            width: 850,
            url: '<%=path%>/project/prjbscinfo/toChoosePrjCstPage.do?id=' + prjId + '&&cstRlFlag=' + cstRlFlag + '&&addPrjPage=' + addPrjPage,
            onClose: function () {
            	//检测是否有审核中的客户主要信息变更流程-BUG-5717
            	var _cstId = $("#cstId").val();
            	checkCstModFlow(_cstId);
            }
        });
    }

    //选择机构页面
    function chooseFundPage() {
    	 var prjTypCd = $("#prjTypCd").val();
    	<%-- if (prjId != "" ) {//修改时提示确定修改后选择机构
    		$.ligerDialog.confirm("变更项目类型会删除所对应的报价方案和支付表信息，确定要变更吗？", function (flag) {
    			if(flag == false) {
    				setPrjTypCd();
    				return;
    			}
    	       $.ligerDialog.open({
    	           title: '选择机构',
    	           height: 500,
    	           width: 850,
    	           url: '<%=path%>/project/prjbscinfo/toChoosePrjFundPage.do?id=' + prjId
    	       });
        	});
    	}else {//添加时选择第三方项目后选择机构 --%>
    		$.ligerDialog.open({
 	           title: '选择机构',
 	           height: 500,
 	           width: 850,
 	           url: '<%=path%>/project/prjbscinfo/toChoosePrjFundPage.do?id=' + prjId + '&&prjTypCd='+prjTypCd
 	       });
    	<%-- } --%>
    }

    function chooseMfrQuatPage() {
        $.ligerDialog.open({
            title: '选择厂商报价器',
            height: 500,
            width: 850,
            url: '<%=path%>/project/calquatprps/toChooseMfrQuatPrpsPage.do'
        });
    }

    //设置是否厂商标志
    function  displayIsSplMfr(preIsSplMfr){
        console.log("preIsSplMfr:"+preIsSplMfr);
        var selectPreIsSplMfr= $("#isSplMfr").ligerGetComboBoxManager();
        if (preIsSplMfr==0) {
            $("#isSplMfr").val('0');
            selectPreIsSplMfr.setValue(isSplMfr);
            selectPreIsSplMfr.setText("否");
            $("#isSplMfrShowDiv").hide();
        } else if (preIsSplMfr==1) {
            $("#isSplMfr").val('1');
            selectPreIsSplMfr.setValue(isSplMfr);
            selectPreIsSplMfr.setText("是");
            $("#isSplMfrShowDiv").show();
        }
    }

    function showCstDetail() {
        if(isBigCstWork == '1' &&  dsCd == 'CHL0047'){
            top.$.ligerDialog.SQalert({content: "经销商报单不可修改客户！", SQ_type: "error"});
            return false;
        }
        var cstId = $("#cstId").val();
        Add_navTab('tab_cst_detail_page' + cstId, '客户详细信息', '<%=path%>/customer/cstbscinfo/toCustDetailPage.do?id=' + cstId);
    }

    function showFundDetail() {
        var fundRasInsId = $("#fundRasInsId").val();
        Add_navTab('tab_fund_detail_page' + fundRasInsId, '机构详细信息', '<%=path%>/project/prjbscinfo/toFundDetailPage.do?id=' + fundRasInsId);
    }
    // 检查项目名称是否重复
    function checkPrjNm() {
        var flag = false;
        var prjNm = $("#prjNm").val();
        var url = '<%=path%>/project/prjbscinfo/checkPrjNm.do';
        var params = {};
        params.prjNm = prjNm;//项目名称
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: params,
            url: url,
            success: function (msg) {
                if (msg.success == 1) {
                    top.$.ligerDialog.SQalert({content: "该项目已经存在！", SQ_type: "error"});
                    flag = true;
                }
            }
        });
        return flag;
    }
    function queryPrjPaySchYQInfo(){
        var prjTypCd = $("#prjTypCd").val();
        var cstId = $("#cstId").val();
        var prjId = $("#prjId").val();
        var orgCd = liger.get("orgCd").getValue();
        var url = '<%=path%>/project/prjPaySchMyq/getPrjPrdPaySchMList.do';
        var params = {};
        params.prjTypCd = prjTypCd;
        params.cstId = cstId;
        params.prjId = prjId;
        params.detailFlag = detailFlag;
        params.cstMgrOrgCd = orgCd;
        params.buOrgCd = buOrgCd;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: params,
            url: url,
            success: function (msg) {
                if (msg.success == 1) {
                    var prjPaySchMYQList = {};
                    if (msg.data.yqList) {
                        prjPaySchMYQList.rows = msg.data.yqList;
                        prjPaySchMYQList.total = msg.data.yqList.length;
                    } else {
                        prjPaySchMYQList.rows = [];
                        prjPaySchMYQList.total = 0;
                    }
                    prjpaySchMYQGrid(prjPaySchMYQList);
                }
                if (msg.success == 0) {
                    var data = {};
                    prjpaySchMYQGrid(data)
                    UIUtils.alertErrorHold1(msg.info);
                }

            }
        });
    }
    //查询客户征信信息
    function queryCstCreditiInvest() {
        var prjTypCd = $("#prjTypCd").val();
        var cstId = $("#cstId").val();
        var prjId = $("#prjId").val();
        var orgCd = liger.get("orgCd").getValue();
        /*  if(searchOrgTree.treeManager.getSelected()){
         orgCd = searchOrgTree.treeManager.getSelected().data['orgCd'];
         } */
        var flag = false;
        var rskLvlCdNm = "";
        var audStsDescText = "";
        var audStsDesc3Text = "";
        var insCode = $("#insCode").val();
        if (insCode && insCode == ProjectConstant.PRJ_INS_CODE_ICBC) {
            $("#icbcAudDiv").show();
        }
        var url = '<%=path%>/project/prjbscinfo/queryCstCreditiInvest.do';
        var params = {};
        params.prjTypCd = prjTypCd; //项目类型
        params.cstId = cstId;
        params.prjId = prjId;
        params.cstMgrOrgCd = orgCd;
        params.insCode = insCode;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: params,
            url: url,
            success: function (msg) {
                if ((cstId != beforeCstId || prjTypCd != beforePrjTypCd) && (msg.success == 1)) {
                    flag = true;
                }

                if (flag) {
                    $("#noticeDiv").show();
                } else {
                    $("#noticeDiv").hide();
                }
                var form = liger.get("prj_bsc_info_form");
                if(msg.signature == "1"){
                    $("#isBigCstWorkDiv").show();
                    if(flag){
                        form.setData({
                            isBigCstWork: "1",
                        });
                    }
                    if($("#isBigCstWork").val() == "1"){
                        $("#bigCstWorkSourceDiv").show();
                    }
                }else{
                    $("#isBigCstWorkDiv").hide();
                    $("#bigCstWorkSourceDiv").hide();
                    form.setData({
                        isBigCstWork: "0",
                    });
                }
                if (msg.success == 1) {
                    isChkFlag = msg.data.isChkFlag;
                    isMateRskLvlCdIsC = msg.data.isMateRskLvlCdIsC;
                    var rcCstBscInfoMap = {};
                    if (msg.data.rcCstBscInfoMap) {
                    	if(msg.data.rcCstBscInfoMap.rcCstBscInfoList){
                    		rcCstBscInfoMap.rows = msg.data.rcCstBscInfoMap.rcCstBscInfoList;
                            rcCstBscInfoMap.total = msg.data.rcCstBscInfoMap.rcCstBscInfoList.length;
                    	}
                    } else {
                        rcCstBscInfoMap.rows = [];
                        rcCstBscInfoMap.total = 0;
                    }
                    cstLRskGrid(rcCstBscInfoMap);

                    if (msg.data.rcCstBscInfoMap != null && msg.data.rcCstBscInfoMap.rlRcCstBscInfoList) {
                        var rlRcCstBscInfoMap = {};
                        if (msg.data.rcCstBscInfoMap.rlRcCstBscInfoList) {
                            rlRcCstBscInfoMap.rows = msg.data.rcCstBscInfoMap.rlRcCstBscInfoList;
                            rlRcCstBscInfoMap.total = msg.data.rcCstBscInfoMap.rlRcCstBscInfoList.length;
                        } else {
                            rlRcCstBscInfoMap.rows = [];
                            rlRcCstBscInfoMap.total = 0;
                        }

                        $("#cstMarStsNm").text(msg.data.marStsCdNm);
                        $("#cstRlNm").text(msg.data.rlNm);
                        $("#rlCstRskTitle").text("配偶（" + msg.data.rlNm + ")征信");
                        $("#cstRlNmDiv").show();
                        $("#cstMarStsDiv").show();
                        $("#rlCstRskDiv").show();
                        $("#rlCstRiskDiv").hide();
                        rlCstLRskGrid(rlRcCstBscInfoMap);
                    } else {
                        $("#cstRlNmDiv").hide();
                        $("#cstMarStsDiv").hide();
                        $("#cstMarStsNm").text(msg.data.marStsCdNm);
                        var rlRcCstBscInfoMap = {};
                        rlRcCstBscInfoMap.rows = [];
                        rlRcCstBscInfoMap.total = 0;
                        rlCstLRskGrid(rlRcCstBscInfoMap);
                        if (msg.data.rlResult) {
                            //$("#rlCstRskTitle").hide();
                            $("#rlCstRskDiv").hide();
                            $("#cstMarStsDiv").show();
                            $("#cstMarStsNm").text(msg.data.marStsCdNm);
                            $("#cstRlNm").text(msg.data.rlNm);
                            $("#cstRlNmDiv").show();
                            $("#rlCstRiskDiv").show();
                            $("#rlCstRisk").text(msg.data.rlResult);
                        }
                    }

                    //浙商征信结果
                    var zsBankResultList = {};
                    if (msg.data.rcCstResultMap && msg.data.rcCstResultMap.浙商银行) {
                    	zsBankResultList.rows = msg.data.rcCstResultMap.浙商银行;
                    	zsBankResultList.total = msg.data.rcCstResultMap.浙商银行.length;
                    	$("#zsBankGridDIV").show();
	                    zsBankGrid(zsBankResultList);
                    } else {
                    	$("#zsBankGridDIV").hide();
                    }
                    if(ProjectConstant.PRJ_TYP_CD_CDDYWYQ == prjTypCd){
                        //重新设置疫情支付表列表
                        queryPrjPaySchYQInfo();
                        $("#prjYQ").show();
                    }


                }
                if (msg.success == 0) {
                    var data = {};
                    cstLRskGrid(data);
                    UIUtils.alertErrorHold1(msg.info);
                }
                /* 	       if(msg.success == 0){
                 if (_isInitPage_flag){
                 UIUtils.alertErrorHold1(msg.info);
                 }else {
                 _isInitPage_flag = true
                 }
                 }  */
            }
        });


    }
    //格式化时间
    function renderDate(rowdata, index, value){
        var dateStr = "";
        if(null != value&&value!=''){
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
    function prjpaySchMYQGrid(data) {
        payAmtGrid = $("#ligergrid_prjYq").ligerGrid({
            data: data,
            columns: [
                { display: '合同编号', name: 'lsCntNo', minWidth: 150 ,align:'left',enabledSort:true},
                { display: '支付表号', name: 'paySchNo', minWidth: 200,align:'left',
                    render: function (rowdata, index, value) {
                        return '<a href="javascript:showPaySchDetail('+rowdata.paySchId+')"'+'class="link">'+rowdata.paySchNo+'</a>';
                    },
                    enabledSort:true},
                { display: '期次', name: 'paySchPd', minWidth: 80,align:'left',enabledSort:true},
                { display: '承租人名称', name: 'cstNm', minWidth: 80,align:'left',enabledSort:true},
                // { display: '状态', name: 'prdStsCdNm', minWidth: 80,align:'left',enabledSort:true},
                { display: '创建时间', name: 'crtTm', minWidth: 80,align:'left',render:renderDate,enabledSort:true},
                //{ display: '结清时间', name: 'stlDt', minWidth: 80,align:'left',render:renderDate,enabledSort:true},
                //{ display: '拖回时间', name: 'backDt', minWidth: 80,align:'left',render:renderDate,enabledSort:true},
                /*{
                    display: '操作',
                    isSort: false,
                    width: 200,
                    align:'center',
                    isEllipsis: false,
                    render: function (rowdata, rowindex, value){
                        var h="";
                        h+='<a class="sq-button-hasicon" href="javascript:payDetail(';
                        h+="'"+rowdata.id+"'";
                        h+=')"><i class="sqBtnIco_2"></i>选择</a>';
                        return h;
                    }
                }*/
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            heightDiff: -2,
            enabledEdit: false,
            isScroll: false,
            checkbox: true,
            rownumbers: true,
            fixedCellHeight: false,
            frozen: false,
            allowUnSelectRow: false,
            alternatingRow: false,
            isChecked: f_isChecked,
            selectable:checkboxYQ,
            rowSelectable:checkboxYQ,
            //选择行
            onSelectRow: function (rowdata, rowid, rowobj) {
                cruChePrjId = rowdata.prjId;
                if (!prjId) {
                    setPrjbscInfoDataById(cruChePrjId);
                } else {
                    if (!nonInitialYQ) {
                        setPrjbscInfoDataById(cruChePrjId);
                    }
                }

                nonInitialYQ = false;
            },
            //选择行之前
            onBeforeCheckRow : function (checked, data, rowid, rowdata) {
                if (null != cruChePrjId && data.prjId != cruChePrjId){
                    $.ligerDialog.SQalert({content: "请选择同一项目的支付表",SQ_type: "warning"});
                    return false;
                }
                return true;
            },
            //取消行
            onUnSelectRow : function (rowdata, rowid, rowobj) {
                cancelCruChePrjId();
            },
        });
    }

    function cancelCruChePrjId() {
        var manager = $("#ligergrid_prjYq").ligerGetGridManager();
        var selecteds = manager.getSelecteds();
        if (selecteds.length == 0) {
            cruChePrjId = null;
        }
    }

    /**
     * 此项目默认选中的数据
     * @param rowdata
     * @returns {boolean}
     */
    function f_isChecked(rowdata){
        if (rowdata.isCx == 1){
            return true;
        }else{
            return false;
        }
    }
   /*
      onCheckRow: f_onCheckRow
     * 此项目默认选中的数据
     * @param rowdata
     * @returns {boolean}
     *!/
    function f_isChecked2(checked, rowdata){
        if(checked){
            if (rowdata.isCx == 1){
                return true;
            }else{
                return false;
            }
        }
    }*/

    function cstLRskGrid(data) {
        payAmtGrid = $("#ligergrid_rsk").ligerGrid({
            data: data,
            columns: [
                {display: '供应商名称', name: 'splNm', minWidth: 140},
                {display: '挂靠公司', id: 'lnkNm', name: 'lnkNm', minWidth: 140},
                {display: '征信评级', name: 'rskLvlCdNm', minWidth: 140},
                {
                    display: '征信结果', name: 'audStsDesc', minWidth: 200, isEllipsis: false,
                    render: function (item) {
                        var audStsDesc3 = "";
                        var audStsDesc = "";
                        if (item.audStsDesc3) {
                            audStsDesc3 = item.audStsDesc3;
                        }
                        if (item.audStsDesc) {
                            audStsDesc = item.audStsDesc;
                        }
                        return audStsDesc3 + audStsDesc;
                    }
                }
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            <%--<c:if test="${buOrgCd =='00000001' && (prjTypCd =='CTYW' || prjTypCd == 'CPYW')}">
            </c:if>--%>
            detail: { onShowDetail: f_showFee },
            detailHeight:100,
            width: '100%',
            heightDiff: -2,
            enabledEdit: false,
            isScroll: false,
            checkbox: false,
            rownumbers: true,
            fixedCellHeight: false,
            frozen: false,
            allowUnSelectRow: false,
            alternatingRow: false
        });
        prjTypCd  = $("#prjTypCd").val();
        if(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD){
            payAmtGrid.toggleCol('lnkNm', true);
        }else{
            payAmtGrid.toggleCol('lnkNm', false);
        }
        payAmtGrid.extendDetailAll();
    }


    function rlCstLRskGrid(data) {
        payAmtGrid = $("#ligergrid_rlCst_rsk").ligerGrid({
            data: data,
            columns: [
                {display: '供应商名称', name: 'splNm', minWidth: 140},
                {display: '挂靠公司', id: 'lnkNm', name: 'lnkNm', minWidth: 140},
                {display: '征信评级', name: 'rskLvlCdNm', minWidth: 140},
                {
                    display: '征信结果', name: 'audStsDesc', minWidth: 200, isEllipsis: false,
                    render: function (item) {
                        var audStsDesc3 = "";
                        var audStsDesc = "";
                        if (item.audStsDesc3) {
                            audStsDesc3 = item.audStsDesc3;
                        }
                        if (item.audStsDesc) {
                            audStsDesc = item.audStsDesc;
                        }
                        return audStsDesc3 + audStsDesc;
                    }
                }
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            heightDiff: -2,
            enabledEdit: false,
            isScroll: false,
            checkbox: false,
            rownumbers: true,
            fixedCellHeight: false,
            frozen: false,
            allowUnSelectRow: false,
            alternatingRow: false
        });
        prjTypCd  = $("#prjTypCd").val();
        if(prjTypCd == ProjectConstant.PRJ_TYP_CD_CDDYWUL || prjTypCd == ProjectConstant.PRJ_TYP_CD_ESCJYD || prjTypCd == ProjectConstant.PRJ_TYP_CD_OWNJYD){
            payAmtGrid.toggleCol('lnkNm', true);
        }else{
            payAmtGrid.toggleCol('lnkNm', false);
        }
    }

    function zsBankGrid(data) {
        $("#ligergrid_zsBank").ligerGrid({
            data: data,
            columns: [
                {display: '供应商名称', name: 'splNm', minWidth: 140},
                {display: '征信评级', name: 'rskLvlCdNm', minWidth: 140},
                {display: '征信结果', name: 'audStsDesc', minWidth: 140},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            heightDiff: -2,
            enabledEdit: false,
            isScroll: false,
            checkbox: false,
            rownumbers: true,
            fixedCellHeight: false,
            frozen: false,
            allowUnSelectRow: false,
            alternatingRow: false
        });
    }

    function odrDetail(){
        Add_navTab('tab_odrbscinfo_detail'+prjId,'预约详情','<%=path%>/carloan/odrbscinfo/toDetailPage.do?id='+prjId);
    }
    
    
    function checkPrject(prjId){
        $.ajax({
            url: '<%=path%>/inscare/insapplication/checkProject.do',
            type: 'get',
            async:false,
            data: {
            	prjId:prjId
            },
           
            dataType: "json",
            success: function (msg) {   //提交成功后自动执行的处理函数，参数data就是服务器返回的数据。
                if (msg.success == 1) {
                	rtnMsg="1";
                  return true;
                } else {
                    rtnMsg=msg.info;
                    return false;
                }
            },
            error: function (data, status, e) {
            	 rtnMsg=msg.info;
            	 return false;
            }
        });
    }

	//判断该客户是否存在状态为"审核中"的《客户主要信息变更流程》-BUG-5717
	function checkCstModFlow(_cstId){
		var params = {cstId:_cstId};
		var _url = '<%=path%>/customer/cstbscinfo/checkCstModFlow.do';
		$.ajax({
    		type:'get',
    		dataType:'json',
    		async:false,
    		url:_url,
    		data:params,
    		success:function(msg){
    			if(msg.success == 1){//存在-不支持立项和评审
					//清空客户信息
                	$("#cstId").val("");
                	$("#cstNm").text("");
                	$("#certNo").val("");
                	$("#certTypCd").val("");
                	$("#certValidSDt").val("");
                	$("#certValidEDt").val("");
                	$("#cstTypCd").val("");
                	top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "warning"});
				}else if(msg.success == 0){//不存在-可以立项和评审
					console.log(_cstId + "：可以立项和评审");
				}
    		},
    		error:function(msg){
    			top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
    		}
    	});
	}

    /**
     * 判断当前项目对应的筛选记录下是否存在筛选结果无对应的项目信息或项目信息为待提交/预审核中/预审核通过/驳回呈报人
     * @param preRouteId  预筛选记录Id
     * @param preResId    预筛选结果Id
     */
    function checkOtherPreResStatus(preRouteId,preResId){
        var params = {
            preRouteId:preRouteId,
            preResId:preResId
        };
        var _url = '<%=path%>/preinsroute/preRouteBscInfo/checkOtherPreResStatus.do';
        $.ajax({
            type:'get',
            dataType:'json',
            async:false,
            url:_url,
            data:params,
            success:function(msg){
                if(msg.success == 1){//存在-展示提示信息(3秒钟后自动关闭)
                    $.ligerDialog.confirm(msg.info, function (flag) {

                    });
                }else if(msg.success == 0){//不存在-直接下一步
                }
            },
            error:function(msg){
                $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                return false;
            }
        });
    }

    //查看支付表明细
    function showPaySchDetail(paySchId){
        $.ajax({
            type: 'get',
            dataType: 'json',
            url: '<%=path%>/risk/ovdCollect/getPayInfo.do?paySchId='+paySchId,
            success: function (msg) {
                if (msg.success == 1) {
                    Add_navTab('tab_prj_quat_prps'+paySchId,'查看支付表','<%=path%>/project/prjprdpayschm/toAddPage.do?prjId='+msg.data.prjId+'&&id='+paySchId+'&&prjPrdDtlId='+msg.data.prjPrdDtlId+'&&prjPrdId='+msg.data.prjPrdId+'&&detailFlag=true');
                }
            }
        });
    }

    //显示公司
    function f_showFee(row, detailPanel,callback){
        if(buOrgCd =='00000001' && (prjTypCd =='CTYW' || prjTypCd == 'CPYW')){

            console.log("f_showFee" + row.rcCstChannelInfoDTOList);
            if(!row.rcCstChannelInfoDTOList || row.rcCstChannelInfoDTOList.length == 0){
                rcCstChannelInfoDTOList = [];
                rcCstChannelInfoDTO = {};
                rcCstChannelInfoDTO.channelNm = '无';
                rcCstChannelInfoDTO.finalUserLevelNm = '无';
                rcCstChannelInfoDTO.discountInfo = '无';
                rcCstChannelInfoDTOList.push(rcCstChannelInfoDTO);
                row.rcCstChannelInfoDTOList = rcCstChannelInfoDTOList;
            }
            var ligerDiv = document.createElement('div');
            $(detailPanel).append(ligerDiv);
            var ligerGrid_guakao = $(ligerDiv).css('height', 100).ligerGrid({
                data: getRows(row.rcCstChannelInfoDTOList),
                dataAction:'local',
                columns: [
                    {display: '挂靠公司', name: 'channelNm', minWidth: 140,
                        render: function (rowdata, rowindex, value){
                            value ==null?"":value;
                            var h = '';
                            if(value){
                                h+='<a href="javascript:guakaoDetailBtn(';
                                h+="'"+rowdata.channelId+"'";
                                h+=')">'+value+'</a>'
                            }
                            return h;
                        },
                    },
                    {display: '狮桥分', id: 'finalUserLevelNm', name: 'finalUserLevelNm', minWidth: 140},
                    {display: '提示', name: 'discountInfo', minWidth: 140},
                ],
                // pageSize: 10,
                // root: 'rows',
                // record: 'total',
                hideLoadButton: true,
                width: '100%',
                height: 100,
                // heightDiff: -2,
                enabledEdit: false,
                isScroll: false,
                // checkbox: true,
                frozen: false,
                rownumbers: true,
                allowUnSelectRow: true,
                alternatingRow: false,
                enabledSort: false, // 增加行的时候，出现问题，所以不过滤了
                fixedCellHeight: false,
                usePager: false,
                // onAfterShowData: function() {
                //     SetIframe_height();
                // },
            });
            row.rcCstChannelInfoDTOList = ligerGrid_guakao.getData() ;
        }
    }

    function getRows(dataList){
        var data = { Rows: [],total:0};
        if (dataList === undefined){
            return data;
        }
        for (var i = 0; i < dataList.length; i++){
            data.Rows.push(dataList[i]);
            data.total ++ ;
        }
        return data;
    }
    //挂靠公司详情
    function guakaoDetailBtn(id) {
        parent.mainApp.f_addTab('tab_prj_lnk_comp_detail' + id, '挂靠公司详情', '<%=path%>/project/prjlnkcomp/toDetailPage.do?id=' + id+'&isMask=1');
    }
</script>

</body>
</html>